@pisell/materials 6.4.18 → 6.4.19
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/index.js +1 -1
- package/build/lowcode/meta.js +3 -3
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +15 -15
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +15 -15
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +3 -1
- package/es/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +24 -0
- package/es/components/dataSourceComponents/fields/Input.Mobile/serve.js +2 -0
- package/es/components/dataSourceComponents/fields/Upload/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Upload/index.js +4 -3
- package/es/components/iconfont/index.d.ts +8 -0
- package/es/components/iconfont/index.js +1 -1
- package/es/components/pisellAdjustPrice/index.d.ts +0 -1
- package/es/components/pisellCardList/index.d.ts +103 -0
- package/es/components/pisellText/components/Editable/index.d.ts +29 -0
- package/es/components/pisellText/components/Editable/index.js +130 -0
- package/es/components/pisellText/components/Editable/index.less +40 -0
- package/es/components/pisellText/index.d.ts +9 -0
- package/es/components/pisellText/index.js +2 -0
- package/es/components/pisellWalletPassCard/index.d.ts +136 -0
- package/es/components/productCard/index.d.ts +7 -0
- package/es/components/productCard/utils.d.ts +31 -0
- package/es/components/productCard/utils.js +1 -8
- package/es/components/select/index.d.ts +9 -0
- package/es/components/select/index.js +4 -2
- package/es/components/sortableList/index.d.ts +11 -0
- package/es/components/sortableList/index.js +2 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +7 -0
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +9 -1
- package/es/components/table/Actions/component/ExportImport/index.js +55 -27
- package/es/components/table/Table/index.d.ts +4 -0
- package/es/components/table/Table/index.js +7 -3
- package/es/components/table/hooks/useTransColumns.d.ts +14 -0
- package/es/components/table/hooks/useTransColumns.js +1 -1
- package/es/components/table/index.d.ts +4 -0
- package/es/components/table/index.js +3 -1
- package/es/components/table/serve.d.ts +13 -0
- package/es/components/table/serve.js +8 -0
- package/es/components/tabs/index.d.ts +17 -0
- package/es/components/tabs/index.js +9 -0
- package/es/components/virtual-keyboard/Amount/index.d.ts +0 -1
- package/es/components/walletCard/index.d.ts +11 -11
- package/es/components/walletCard/index.js +51 -40
- package/es/index.d.ts +145 -0
- package/es/locales/en-US.d.ts +307 -0
- package/es/locales/en-US.js +2 -2
- package/es/locales/zh-CN.d.ts +302 -0
- package/es/locales/zh-CN.js +1 -1
- package/es/locales/zh-TW.d.ts +302 -0
- package/es/locales/zh-TW.js +1 -1
- package/es/typings.d.ts +7 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +24 -0
- package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.js +2 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.js +2 -1
- package/lib/components/iconfont/index.d.ts +8 -0
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/pisellAdjustPrice/index.d.ts +0 -1
- package/lib/components/pisellCardList/index.d.ts +103 -0
- package/lib/components/pisellText/components/Editable/index.d.ts +29 -0
- package/lib/components/pisellText/components/Editable/index.js +139 -0
- package/lib/components/pisellText/components/Editable/index.less +40 -0
- package/lib/components/pisellText/index.d.ts +9 -0
- package/lib/components/pisellText/index.js +2 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +136 -0
- package/lib/components/productCard/index.d.ts +7 -0
- package/lib/components/productCard/utils.d.ts +31 -0
- package/lib/components/productCard/utils.js +1 -8
- package/lib/components/select/index.d.ts +9 -0
- package/lib/components/select/index.js +7 -2
- package/lib/components/sortableList/index.d.ts +11 -0
- package/lib/components/sortableList/index.js +2 -2
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +7 -0
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +7 -1
- package/lib/components/table/Actions/component/ExportImport/index.js +37 -25
- package/lib/components/table/Table/index.d.ts +4 -0
- package/lib/components/table/Table/index.js +8 -4
- package/lib/components/table/hooks/useTransColumns.d.ts +14 -0
- package/lib/components/table/hooks/useTransColumns.js +1 -1
- package/lib/components/table/index.d.ts +4 -0
- package/lib/components/table/index.js +3 -1
- package/lib/components/table/serve.d.ts +13 -0
- package/lib/components/table/serve.js +8 -0
- package/lib/components/tabs/index.d.ts +17 -0
- package/lib/components/tabs/index.js +5 -0
- package/lib/components/virtual-keyboard/Amount/index.d.ts +0 -1
- package/lib/components/walletCard/index.d.ts +11 -11
- package/lib/components/walletCard/index.js +47 -29
- package/lib/index.d.ts +145 -0
- package/lib/locales/en-US.d.ts +307 -0
- package/lib/locales/en-US.js +2 -2
- package/lib/locales/zh-CN.d.ts +302 -0
- package/lib/locales/zh-CN.js +1 -1
- package/lib/locales/zh-TW.d.ts +302 -0
- package/lib/locales/zh-TW.js +1 -1
- package/lib/typings.d.ts +7 -1
- package/lowcode/pisell-text.editable/meta.ts +115 -0
- package/lowcode/pisell-text.editable/snippets.ts +15 -0
- package/lowcode/sortable-list/meta.ts +1 -1
- package/lowcode/wallet-card/meta.ts +16 -14
- package/package.json +2 -2
- package/es/components/auto-resize-text/auto-text-size-standalone.d.ts +0 -20
- package/es/components/auto-resize-text/index.d.ts +0 -6
- package/es/components/cardPro/index.d.ts +0 -4
- package/es/components/drag-sort-tree/TreeItem/index.d.ts +0 -18
- package/es/components/keyboard/index.d.ts +0 -22
- package/es/components/pisell-config-provider/context.d.ts +0 -22
- package/es/components/pisellAdjustPrice/status.d.ts +0 -32
- package/es/components/pisellAdjustPrice/type.d.ts +0 -22
- package/es/components/pisellCheckboxGroup/index.d.ts +0 -40
- package/es/components/pisellText/components/Amount/index.d.ts +0 -20
- package/es/components/pisellToast/index.d.ts +0 -17
- package/es/components/pisellToast/squareToast/methods.d.ts +0 -13
- package/es/components/pisellToast/squareToast/renderImperatively.d.ts +0 -29
- package/es/components/pisellToast/squareToast/toast.d.ts +0 -25
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +0 -4
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +0 -4
- package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +0 -14
- package/es/components/productCard/cartSkuCard/components/Note/index.d.ts +0 -4
- package/es/components/productCard/cartSkuCard/components/discountReason/index.d.ts +0 -3
- package/es/components/productCard/cartSkuCard/components/packages/index.d.ts +0 -11
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +0 -20
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +0 -4
- package/es/components/productCard/cartSkuCard/components/sales/index.d.ts +0 -13
- package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +0 -4
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +0 -46
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -7
- package/es/components/productCard/components/Action/index.d.ts +0 -4
- package/es/components/productCard/components/Header/index.d.ts +0 -4
- package/es/components/productCard/components/Sales/index.d.ts +0 -4
- package/es/components/productCard/components/Time/components/SelectHolderModal/index.d.ts +0 -14
- package/es/components/productCard/locales.d.ts +0 -84
- package/es/components/table/Table/AddFieldModal/index.d.ts +0 -4
- package/es/components/virtual-keyboard/Amount/themeConfig.d.ts +0 -32
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -15
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +0 -21
- package/es/components/virtual-keyboard/Number/themeConfig.d.ts +0 -32
- package/es/components/virtual-keyboard/Number/types.d.ts +0 -26
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -13
- package/es/components/virtual-keyboard/index.d.ts +0 -25
- package/es/components/virtualInput/BaseVirtualInput/index.d.ts +0 -40
- package/lib/components/auto-resize-text/auto-text-size-standalone.d.ts +0 -20
- package/lib/components/auto-resize-text/index.d.ts +0 -6
- package/lib/components/cardPro/index.d.ts +0 -4
- package/lib/components/drag-sort-tree/TreeItem/index.d.ts +0 -18
- package/lib/components/keyboard/index.d.ts +0 -22
- package/lib/components/pisell-config-provider/context.d.ts +0 -22
- package/lib/components/pisellAdjustPrice/status.d.ts +0 -32
- package/lib/components/pisellAdjustPrice/type.d.ts +0 -22
- package/lib/components/pisellCheckboxGroup/index.d.ts +0 -40
- package/lib/components/pisellText/components/Amount/index.d.ts +0 -20
- package/lib/components/pisellToast/index.d.ts +0 -17
- package/lib/components/pisellToast/squareToast/methods.d.ts +0 -13
- package/lib/components/pisellToast/squareToast/renderImperatively.d.ts +0 -29
- package/lib/components/pisellToast/squareToast/toast.d.ts +0 -25
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +0 -4
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +0 -4
- package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +0 -14
- package/lib/components/productCard/cartSkuCard/components/Note/index.d.ts +0 -4
- package/lib/components/productCard/cartSkuCard/components/discountReason/index.d.ts +0 -3
- package/lib/components/productCard/cartSkuCard/components/packages/index.d.ts +0 -11
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +0 -20
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +0 -4
- package/lib/components/productCard/cartSkuCard/components/sales/index.d.ts +0 -13
- package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +0 -4
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +0 -46
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +0 -7
- package/lib/components/productCard/components/Action/index.d.ts +0 -4
- package/lib/components/productCard/components/Header/index.d.ts +0 -4
- package/lib/components/productCard/components/Sales/index.d.ts +0 -4
- package/lib/components/productCard/components/Time/components/SelectHolderModal/index.d.ts +0 -14
- package/lib/components/productCard/locales.d.ts +0 -84
- package/lib/components/table/Table/AddFieldModal/index.d.ts +0 -4
- package/lib/components/virtual-keyboard/Amount/themeConfig.d.ts +0 -32
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +0 -15
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +0 -21
- package/lib/components/virtual-keyboard/Number/themeConfig.d.ts +0 -32
- package/lib/components/virtual-keyboard/Number/types.d.ts +0 -26
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +0 -13
- package/lib/components/virtual-keyboard/index.d.ts +0 -25
- package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +0 -40
|
@@ -97,13 +97,6 @@ export var getServiceTime = function getServiceTime(item, currentDate) {
|
|
|
97
97
|
// 中文:年月日 开始时间 - 年月日 结束时间
|
|
98
98
|
dateTime = "".concat(startDate.format(dateFormat), " ").concat(startTime, " ~ ").concat(endDate.format(dateFormat), " ").concat(endTime);
|
|
99
99
|
}
|
|
100
|
-
if (durationType === 'days') {
|
|
101
|
-
dateTime = formatMultiDayDate({
|
|
102
|
-
start_date: startDate.format('YYYY-MM-DD'),
|
|
103
|
-
end_date: endDate.format('YYYY-MM-DD'),
|
|
104
|
-
locale: locale
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
100
|
}
|
|
108
101
|
var startDateTime = "".concat(startDate.format('YYYY-MM-DD'), " ").concat(startTime);
|
|
109
102
|
var endDateTime = "".concat(endDate.format('YYYY-MM-DD'), " ").concat(endTime);
|
|
@@ -115,7 +108,7 @@ export var getServiceTime = function getServiceTime(item, currentDate) {
|
|
|
115
108
|
var minutes = _duration % 60;
|
|
116
109
|
durationText = locales.getText('pisell2.product.card.hour.minute')(hours, minutes);
|
|
117
110
|
} else if (durationType === 'days') {
|
|
118
|
-
durationText =
|
|
111
|
+
durationText = locales.getText('pisell2.product.card.day')(_duration);
|
|
119
112
|
} else {
|
|
120
113
|
durationText = "".concat(_duration);
|
|
121
114
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Select as OriginalSelect } from 'antd';
|
|
3
|
+
import type { SelectProps } from 'antd';
|
|
4
|
+
import './index.less';
|
|
5
|
+
interface CompoundedComponent extends React.ForwardRefExoticComponent<SelectProps> {
|
|
6
|
+
Option: typeof OriginalSelect.Option;
|
|
7
|
+
}
|
|
8
|
+
declare const Select: CompoundedComponent;
|
|
9
|
+
export default Select;
|
|
@@ -23,6 +23,7 @@ var SelectBase = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
23
23
|
options = props.options,
|
|
24
24
|
propsDropdownRender = props.dropdownRender,
|
|
25
25
|
showSearch = props.showSearch,
|
|
26
|
+
onSearch = props.onSearch,
|
|
26
27
|
styleType = props.styleType,
|
|
27
28
|
_props$optionFilterPr = props.optionFilterProp,
|
|
28
29
|
optionFilterProp = _props$optionFilterPr === void 0 ? 'value' : _props$optionFilterPr,
|
|
@@ -87,7 +88,8 @@ var SelectBase = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
87
88
|
placeholder: getText('select-dropdown-render-search'),
|
|
88
89
|
value: searchValue,
|
|
89
90
|
onChange: function onChange(e) {
|
|
90
|
-
|
|
91
|
+
onSearch === null || onSearch === void 0 || onSearch(e.target.value);
|
|
92
|
+
setSearchValue(e.target.value);
|
|
91
93
|
},
|
|
92
94
|
bordered: false,
|
|
93
95
|
allowClear: true,
|
|
@@ -105,7 +107,7 @@ var SelectBase = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
105
107
|
onChange: onSelectAllChange,
|
|
106
108
|
checked: checkboxChecked
|
|
107
109
|
}, getText('select-dropdown-render-select-all')))));
|
|
108
|
-
}, [isShowDropdown, isShowSelectAll, checkboxChecked, propsDropdownRender, searchValue, showSearch]);
|
|
110
|
+
}, [isShowDropdown, isShowSelectAll, checkboxChecked, propsDropdownRender, searchValue, showSearch, onSearch]);
|
|
109
111
|
if (styleType === 'system') {
|
|
110
112
|
return /*#__PURE__*/React.createElement(BrowserSelect, props);
|
|
111
113
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Props } from "../DragSortList";
|
|
3
|
+
export interface SortableListProps<T> {
|
|
4
|
+
dataSource: Props<T>["list"];
|
|
5
|
+
onChange: Props<T>["onChange"];
|
|
6
|
+
rowKey: Props<T>["rowKey"];
|
|
7
|
+
renderItem?: (item: T, index: number) => React.ReactNode;
|
|
8
|
+
activationConstraint?: Props<T>["activationConstraint"];
|
|
9
|
+
}
|
|
10
|
+
declare const SortableList: React.FC<SortableListProps<any>>;
|
|
11
|
+
export default SortableList;
|
|
@@ -18,13 +18,14 @@ var SortableList = function SortableList(props) {
|
|
|
18
18
|
activationConstraint: activationConstraint
|
|
19
19
|
}, function (params) {
|
|
20
20
|
var item = params.item,
|
|
21
|
+
index = params.index,
|
|
21
22
|
p = params.props,
|
|
22
23
|
attributes = params.attributes,
|
|
23
24
|
listeners = params.listeners,
|
|
24
25
|
style = params.style;
|
|
25
26
|
return /*#__PURE__*/React.createElement("div", _extends({}, p, attributes, listeners, {
|
|
26
27
|
style: style
|
|
27
|
-
}), renderItem === null || renderItem === void 0 ? void 0 : renderItem(item));
|
|
28
|
+
}), renderItem === null || renderItem === void 0 ? void 0 : renderItem(item, index));
|
|
28
29
|
});
|
|
29
30
|
};
|
|
30
31
|
export default SortableList;
|
package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js
CHANGED
|
@@ -12,6 +12,12 @@ import { getText } from "../../../../../../../locales/index";
|
|
|
12
12
|
import { exportData } from "../../../../../serve";
|
|
13
13
|
import { defaultOptions } from "../../../../../status";
|
|
14
14
|
import { getFileDateName } from "../../utils/file";
|
|
15
|
+
var exportImportTypeMap = {
|
|
16
|
+
'current-page': 'page',
|
|
17
|
+
'all-records': 'all',
|
|
18
|
+
'selected-records': 'select'
|
|
19
|
+
};
|
|
20
|
+
|
|
15
21
|
// 导出接口
|
|
16
22
|
var _batchExport = /*#__PURE__*/function () {
|
|
17
23
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
@@ -52,7 +58,8 @@ export var batchExport = function batchExport(exportParams, exportImport) {
|
|
|
52
58
|
apiUrl = exportImport.apiUrl,
|
|
53
59
|
otherParams = exportImport.otherParams;
|
|
54
60
|
var _name = getFileDateName();
|
|
55
|
-
|
|
61
|
+
// 拆分导入导出参数
|
|
62
|
+
var params = otherParams !== null && otherParams !== void 0 && otherParams.export ? _objectSpread({}, otherParams === null || otherParams === void 0 ? void 0 : otherParams.export) : _objectSpread({}, otherParams);
|
|
56
63
|
params.url = apiUrl === null || apiUrl === void 0 ? void 0 : apiUrl.export;
|
|
57
64
|
console.log("exportParams", exportParams);
|
|
58
65
|
var type = (exportParams === null || exportParams === void 0 ? void 0 : exportParams.type) || defaultOptions.exportType;
|
|
@@ -95,5 +102,6 @@ export var batchExport = function batchExport(exportParams, exportImport) {
|
|
|
95
102
|
} else {
|
|
96
103
|
params === null || params === void 0 || delete params.ids;
|
|
97
104
|
}
|
|
105
|
+
params.export_select = exportImportTypeMap[type];
|
|
98
106
|
return _batchExport(params);
|
|
99
107
|
};
|
|
@@ -55,6 +55,10 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
55
55
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
56
56
|
errorStatus = _useState10[0],
|
|
57
57
|
setErrorStatus = _useState10[1];
|
|
58
|
+
var _useState11 = useState(false),
|
|
59
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
60
|
+
loading = _useState12[0],
|
|
61
|
+
setLoading = _useState12[1];
|
|
58
62
|
var _useSharedState = useSharedState(Context),
|
|
59
63
|
state = _useSharedState.state;
|
|
60
64
|
var originResultDataSource = state.originResultDataSource,
|
|
@@ -147,9 +151,11 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
147
151
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
148
152
|
while (1) switch (_context.prev = _context.next) {
|
|
149
153
|
case 0:
|
|
150
|
-
apiUrl = exportImport.apiUrl, otherParams = exportImport.otherParams;
|
|
154
|
+
apiUrl = exportImport.apiUrl, otherParams = exportImport.otherParams;
|
|
155
|
+
setLoading(true);
|
|
156
|
+
_context.prev = 2;
|
|
151
157
|
if (!(value === defaultOptions.exportValue)) {
|
|
152
|
-
_context.next =
|
|
158
|
+
_context.next = 11;
|
|
153
159
|
break;
|
|
154
160
|
}
|
|
155
161
|
_params = {
|
|
@@ -157,41 +163,62 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
157
163
|
originDataSource: originResultDataSource,
|
|
158
164
|
currentDataSource: currentDataSource
|
|
159
165
|
};
|
|
160
|
-
_context.next =
|
|
166
|
+
_context.next = 7;
|
|
161
167
|
return batchExport(_params, exportImport);
|
|
162
|
-
case
|
|
168
|
+
case 7:
|
|
163
169
|
result = _context.sent;
|
|
164
170
|
if (result) {
|
|
165
171
|
onCancel();
|
|
166
172
|
}
|
|
167
|
-
_context.next =
|
|
173
|
+
_context.next = 24;
|
|
168
174
|
break;
|
|
169
|
-
case
|
|
170
|
-
if (value === defaultOptions.importValue) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
175
|
+
case 11:
|
|
176
|
+
if (!(value === defaultOptions.importValue)) {
|
|
177
|
+
_context.next = 24;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
formData = new FormData();
|
|
181
|
+
formData.append('file', file);
|
|
182
|
+
formId = otherParams === null || otherParams === void 0 ? void 0 : otherParams.form_id;
|
|
183
|
+
formCode = otherParams === null || otherParams === void 0 ? void 0 : otherParams.code;
|
|
184
|
+
if (formId) {
|
|
185
|
+
formData.append('form_id', formId);
|
|
186
|
+
}
|
|
187
|
+
if (formCode) {
|
|
188
|
+
formData.append('code', formCode);
|
|
189
|
+
}
|
|
190
|
+
formData.append('url', (apiUrl === null || apiUrl === void 0 ? void 0 : apiUrl.import) || '');
|
|
191
|
+
if (otherParams.import) {
|
|
192
|
+
Object.entries(otherParams.import).forEach(function (_ref5) {
|
|
193
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
194
|
+
key = _ref6[0],
|
|
195
|
+
value = _ref6[1];
|
|
196
|
+
formData.append(key, value);
|
|
197
|
+
});
|
|
189
198
|
}
|
|
190
|
-
|
|
199
|
+
if (!formData) {
|
|
200
|
+
_context.next = 24;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
message.loading({
|
|
204
|
+
content: 'Loading...',
|
|
205
|
+
key: value
|
|
206
|
+
});
|
|
207
|
+
_context.next = 24;
|
|
208
|
+
return _batchImport.run(formData);
|
|
209
|
+
case 24:
|
|
210
|
+
_context.next = 28;
|
|
211
|
+
break;
|
|
212
|
+
case 26:
|
|
213
|
+
_context.prev = 26;
|
|
214
|
+
_context.t0 = _context["catch"](2);
|
|
215
|
+
case 28:
|
|
216
|
+
setLoading(false);
|
|
217
|
+
case 29:
|
|
191
218
|
case "end":
|
|
192
219
|
return _context.stop();
|
|
193
220
|
}
|
|
194
|
-
}, _callee);
|
|
221
|
+
}, _callee, null, [[2, 26]]);
|
|
195
222
|
}));
|
|
196
223
|
return function onOk() {
|
|
197
224
|
return _ref4.apply(this, arguments);
|
|
@@ -226,6 +253,7 @@ var ExportImport = function ExportImport(_ref) {
|
|
|
226
253
|
onOk: onOk,
|
|
227
254
|
cancelText: getText('table-action-export-import-cancel'),
|
|
228
255
|
okButtonProps: {
|
|
256
|
+
loading: loading,
|
|
229
257
|
disabled: value === defaultOptions.importValue && (!file || !!errorStatus)
|
|
230
258
|
}
|
|
231
259
|
}, /*#__PURE__*/React.createElement(Content, {
|
|
@@ -57,11 +57,14 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
57
57
|
payload: newData
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
|
-
var handleResize = function handleResize(index) {
|
|
60
|
+
var handleResize = function handleResize(index, record) {
|
|
61
61
|
return function (e, _ref2) {
|
|
62
62
|
var size = _ref2.size;
|
|
63
|
-
var
|
|
64
|
-
|
|
63
|
+
var findIndex = column_setting.findIndex(function (item) {
|
|
64
|
+
return item.dataIndex === record.dataIndex;
|
|
65
|
+
});
|
|
66
|
+
var nextColumns = _toConsumableArray(column_setting);
|
|
67
|
+
nextColumns[findIndex] = _objectSpread(_objectSpread({}, nextColumns[findIndex]), {}, {
|
|
65
68
|
width: size.width
|
|
66
69
|
});
|
|
67
70
|
form.setFieldValue('column_setting', nextColumns);
|
|
@@ -97,6 +100,7 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
97
100
|
var components = useGenTableComponents({
|
|
98
101
|
form: form
|
|
99
102
|
});
|
|
103
|
+
console.log(columns, 'columns12');
|
|
100
104
|
var showTotal = useCallback(function (total, range, pageSize) {
|
|
101
105
|
var start = range[0] - 1;
|
|
102
106
|
var _current = start / pageSize + 1;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormInstance } from "antd/es/form";
|
|
2
|
+
declare type UseTransColumnsProps = {
|
|
3
|
+
columns: Record<string, any>[];
|
|
4
|
+
form: FormInstance;
|
|
5
|
+
localPagination: boolean;
|
|
6
|
+
handleSave?: (row: Record<string, any>) => void;
|
|
7
|
+
handleResize?: (index: number, record: Record<string, any>) => (e: any, p2: any) => void;
|
|
8
|
+
dragSort: boolean;
|
|
9
|
+
bordered: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const useTransColumns: (params: UseTransColumnsProps) => {
|
|
12
|
+
columns: any[];
|
|
13
|
+
};
|
|
14
|
+
export default useTransColumns;
|
|
@@ -186,7 +186,7 @@ var useTransColumns = function useTransColumns(params) {
|
|
|
186
186
|
return _objectSpread(_objectSpread({
|
|
187
187
|
record: record
|
|
188
188
|
}, item), {}, {
|
|
189
|
-
onResize: handleResize === null || handleResize === void 0 ? void 0 : handleResize(index),
|
|
189
|
+
onResize: handleResize === null || handleResize === void 0 ? void 0 : handleResize(index, record),
|
|
190
190
|
position: position
|
|
191
191
|
});
|
|
192
192
|
}
|
|
@@ -252,7 +252,9 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
252
252
|
try {
|
|
253
253
|
if (!tableId) return {};
|
|
254
254
|
var setting = getTableSettingByCurrentViewMode(tableId, currentViewMode);
|
|
255
|
-
|
|
255
|
+
var filters = (setting === null || setting === void 0 ? void 0 : setting.filters) || {};
|
|
256
|
+
filters.order_by = (setting === null || setting === void 0 ? void 0 : setting.order_by) || '';
|
|
257
|
+
return filters;
|
|
256
258
|
} catch (e) {
|
|
257
259
|
return {};
|
|
258
260
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare type exportParams = {
|
|
2
|
+
ids?: Array<string | number>;
|
|
3
|
+
file_name?: string;
|
|
4
|
+
form_id?: string | number;
|
|
5
|
+
code?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const exportData: (params: exportParams) => Promise<any>;
|
|
9
|
+
export declare const batchImport: (params: any) => Promise<any>;
|
|
10
|
+
export declare const importTemplate: (params: exportParams) => Promise<any>;
|
|
11
|
+
export declare const getExportFile: (params: any) => Promise<any>;
|
|
12
|
+
export declare const getImportLog: (params: any) => Promise<any>;
|
|
13
|
+
export {};
|
|
@@ -26,6 +26,14 @@ var defaultUrl = {
|
|
|
26
26
|
* @Date: 2024-09-05 12:01
|
|
27
27
|
*/
|
|
28
28
|
var formatApiParams = function formatApiParams(params, type) {
|
|
29
|
+
if (params instanceof FormData) {
|
|
30
|
+
var url = params.get('url');
|
|
31
|
+
params.delete('url');
|
|
32
|
+
return {
|
|
33
|
+
url: url || (defaultUrl === null || defaultUrl === void 0 ? void 0 : defaultUrl[type]),
|
|
34
|
+
params: params
|
|
35
|
+
};
|
|
36
|
+
}
|
|
29
37
|
var _url = (params === null || params === void 0 ? void 0 : params.url) || (defaultUrl === null || defaultUrl === void 0 ? void 0 : defaultUrl[type]);
|
|
30
38
|
var _params = _objectSpread({}, params);
|
|
31
39
|
delete _params.url;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { TabsProps } from 'antd';
|
|
3
|
+
import './index.less';
|
|
4
|
+
declare class Tabs extends Component<any> {
|
|
5
|
+
state: {
|
|
6
|
+
activeKey: any;
|
|
7
|
+
};
|
|
8
|
+
componentDidMount(): void;
|
|
9
|
+
componentDidUpdate(prevProps: Readonly<any>): void;
|
|
10
|
+
private _handleChange;
|
|
11
|
+
setActiveKey: (key: string) => void;
|
|
12
|
+
getActiveKey: () => any;
|
|
13
|
+
renderIconLabelTabBar: TabsProps['renderTabBar'];
|
|
14
|
+
filterHiddenTabs: (tabs: any[]) => any[];
|
|
15
|
+
render(): JSX.Element;
|
|
16
|
+
}
|
|
17
|
+
export default Tabs;
|
|
@@ -100,6 +100,15 @@ var Tabs = /*#__PURE__*/function (_Component) {
|
|
|
100
100
|
value: function componentDidMount() {
|
|
101
101
|
document.body.id = 'body'; // 解决 antd tabs 样式问题
|
|
102
102
|
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "componentDidUpdate",
|
|
105
|
+
value: function componentDidUpdate(prevProps) {
|
|
106
|
+
if (prevProps.activeKey !== this.props.activeKey) {
|
|
107
|
+
this.setState({
|
|
108
|
+
activeKey: this.props.activeKey
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
103
112
|
}, {
|
|
104
113
|
key: "render",
|
|
105
114
|
value: function render() {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.less';
|
|
3
|
-
declare global {
|
|
4
|
-
namespace JSX {
|
|
5
|
-
interface IntrinsicElements {
|
|
6
|
-
[elemName: string]: any;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
3
|
export interface WalletCardItem {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
type: string;
|
|
5
|
+
custom_title?: string | {
|
|
6
|
+
original: string;
|
|
7
|
+
en: string;
|
|
8
|
+
'zh-CN': string;
|
|
9
|
+
'zh-HK': string;
|
|
10
|
+
};
|
|
11
|
+
display?: 0 | 1;
|
|
14
12
|
value?: number;
|
|
15
13
|
}
|
|
16
14
|
export interface WalletCardProps {
|
|
15
|
+
/** 钱包ID */
|
|
16
|
+
id?: string;
|
|
17
17
|
/** 二维码弹窗适配平台 */
|
|
18
18
|
platform?: 'pc' | 'h5' | 'ipad';
|
|
19
19
|
/** 卡片主题 */
|
|
@@ -21,7 +21,7 @@ export interface WalletCardProps {
|
|
|
21
21
|
/** 默认还是完整显示code */
|
|
22
22
|
cardStyle?: 'normal' | 'full';
|
|
23
23
|
/** 条形码还是二维码 */
|
|
24
|
-
codeType?: 'barCode' | '
|
|
24
|
+
codeType?: 'barCode' | 'qrCode';
|
|
25
25
|
/** 二维码方向 */
|
|
26
26
|
codeDirection?: 'bottom' | 'top';
|
|
27
27
|
/** 自定义背景图 */
|
|
@@ -4,10 +4,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
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; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -28,8 +24,6 @@ import Guest from "./Guest";
|
|
|
28
24
|
import Guide from "./Guide";
|
|
29
25
|
import "./index.less";
|
|
30
26
|
|
|
31
|
-
// 添加JSX类型声明
|
|
32
|
-
|
|
33
27
|
// 类型定义
|
|
34
28
|
|
|
35
29
|
// 默认值
|
|
@@ -41,7 +35,7 @@ var DEFAULT_PROPS = {
|
|
|
41
35
|
showWalletName: true,
|
|
42
36
|
shopName: 'Store name',
|
|
43
37
|
showShopName: true,
|
|
44
|
-
cardNo: '
|
|
38
|
+
cardNo: 'WL0000000001',
|
|
45
39
|
cardStyle: 'normal',
|
|
46
40
|
codeType: 'barCode',
|
|
47
41
|
platform: 'pc',
|
|
@@ -51,21 +45,41 @@ var DEFAULT_PROPS = {
|
|
|
51
45
|
walletName: 'Level',
|
|
52
46
|
isLogin: true,
|
|
53
47
|
items: [{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
type: 'rechargeable',
|
|
49
|
+
display: 1,
|
|
50
|
+
custom_title: {
|
|
51
|
+
original: 'Balance',
|
|
52
|
+
'zh-CN': '充值卡',
|
|
53
|
+
'zh-HK': '充值卡',
|
|
54
|
+
en: 'Balance'
|
|
55
|
+
}
|
|
57
56
|
}, {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
type: 'point',
|
|
58
|
+
display: 1,
|
|
59
|
+
custom_title: {
|
|
60
|
+
original: 'Points',
|
|
61
|
+
'zh-CN': '积分卡',
|
|
62
|
+
'zh-HK': '積分卡',
|
|
63
|
+
en: 'Points'
|
|
64
|
+
}
|
|
61
65
|
}, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
type: 'voucher',
|
|
67
|
+
display: 1,
|
|
68
|
+
custom_title: {
|
|
69
|
+
original: 'Voucher',
|
|
70
|
+
'zh-CN': '代金券',
|
|
71
|
+
'zh-HK': '代金券',
|
|
72
|
+
en: 'Voucher'
|
|
73
|
+
}
|
|
65
74
|
}, {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
75
|
+
type: 'discount',
|
|
76
|
+
display: 1,
|
|
77
|
+
custom_title: {
|
|
78
|
+
original: 'Discount',
|
|
79
|
+
'zh-CN': '折扣卡',
|
|
80
|
+
'zh-HK': '折扣卡',
|
|
81
|
+
en: 'Discount'
|
|
82
|
+
}
|
|
69
83
|
}]
|
|
70
84
|
};
|
|
71
85
|
|
|
@@ -93,7 +107,7 @@ var useCodeModal = function useCodeModal(cardNo, onCodeClick, codeType) {
|
|
|
93
107
|
if (interaction !== null && interaction !== void 0 && (_interaction$utils = interaction.utils) !== null && _interaction$utils !== void 0 && (_interaction$utils$is = _interaction$utils.isAppEnv) !== null && _interaction$utils$is !== void 0 && _interaction$utils$is.call(_interaction$utils)) {
|
|
94
108
|
var _interaction$utils2, _interaction$utils2$p;
|
|
95
109
|
var typeMap = {
|
|
96
|
-
|
|
110
|
+
qrCode: 'qrCode',
|
|
97
111
|
barCode: 'barCode'
|
|
98
112
|
};
|
|
99
113
|
interaction === null || interaction === void 0 || (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 || (_interaction$utils2$p = _interaction$utils2.postMessageToApp) === null || _interaction$utils2$p === void 0 || _interaction$utils2$p.call(_interaction$utils2, {
|
|
@@ -198,49 +212,44 @@ var CardHeader = function CardHeader(_ref2) {
|
|
|
198
212
|
|
|
199
213
|
// 子组件:卡片内容项
|
|
200
214
|
var CardItem = function CardItem(_ref3) {
|
|
215
|
+
var _context$appHelper2;
|
|
201
216
|
var item = _ref3.item,
|
|
202
217
|
symbol = _ref3.symbol;
|
|
203
|
-
var
|
|
204
|
-
|
|
218
|
+
var type = item.type,
|
|
219
|
+
custom_title = item.custom_title,
|
|
205
220
|
value = item.value;
|
|
221
|
+
var context = useEngineContext();
|
|
222
|
+
var utils = context === null || context === void 0 || (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.utils;
|
|
223
|
+
var translationOriginal = (utils === null || utils === void 0 ? void 0 : utils.translationOriginal) || (utils === null || utils === void 0 ? void 0 : utils.translation);
|
|
206
224
|
return /*#__PURE__*/React.createElement("div", {
|
|
207
225
|
className: "pisell-wallet-card-item"
|
|
208
226
|
}, /*#__PURE__*/React.createElement("div", {
|
|
209
227
|
className: "pisell-wallet-card-item-label"
|
|
210
|
-
},
|
|
228
|
+
}, translationOriginal(custom_title || '') || ''), /*#__PURE__*/React.createElement("div", {
|
|
211
229
|
className: "pisell-wallet-card-item-value"
|
|
212
|
-
},
|
|
230
|
+
}, type === 'rechargeable' ? /*#__PURE__*/React.createElement(Amount, {
|
|
213
231
|
className: "pisell-card-amount-item-value",
|
|
214
232
|
platform: "h5",
|
|
215
233
|
symbol: symbol,
|
|
216
234
|
useThousandsSeparator: true,
|
|
217
235
|
showCurrencySymbol: true,
|
|
218
236
|
value: value
|
|
219
|
-
}) : value));
|
|
237
|
+
}) : value || '0'));
|
|
220
238
|
};
|
|
221
239
|
|
|
222
240
|
// 子组件:卡片内容
|
|
223
241
|
var CardContent = function CardContent(_ref4) {
|
|
224
242
|
var items = _ref4.items,
|
|
225
243
|
symbol = _ref4.symbol;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
// 对 items 进行排序
|
|
230
|
-
var sortedItems = useMemo(function () {
|
|
231
|
-
if (!(items !== null && items !== void 0 && items.length)) return [];
|
|
232
|
-
return _toConsumableArray(items).sort(function (a, b) {
|
|
233
|
-
var indexA = expectedOrder.indexOf(a.key);
|
|
234
|
-
var indexB = expectedOrder.indexOf(b.key);
|
|
235
|
-
return indexA - indexB;
|
|
236
|
-
});
|
|
237
|
-
}, [items]);
|
|
244
|
+
var filteredItems = (items || []).filter(function (item) {
|
|
245
|
+
return item.display !== 0;
|
|
246
|
+
});
|
|
238
247
|
return /*#__PURE__*/React.createElement("div", {
|
|
239
248
|
className: "pisell-wallet-card-list",
|
|
240
249
|
style: {
|
|
241
|
-
justifyContent:
|
|
250
|
+
justifyContent: filteredItems.length > 1 ? 'space-between' : 'flex-start'
|
|
242
251
|
}
|
|
243
|
-
},
|
|
252
|
+
}, filteredItems.map(function (item, index) {
|
|
244
253
|
return /*#__PURE__*/React.createElement(CardItem, {
|
|
245
254
|
key: index,
|
|
246
255
|
item: item,
|
|
@@ -386,7 +395,9 @@ var WalletCard = function WalletCard(props) {
|
|
|
386
395
|
}
|
|
387
396
|
utils === null || utils === void 0 || utils.action({
|
|
388
397
|
type: 'pisell1.goWallet',
|
|
389
|
-
data: {
|
|
398
|
+
data: {
|
|
399
|
+
id: props.id
|
|
400
|
+
},
|
|
390
401
|
callback: function callback() {}
|
|
391
402
|
});
|
|
392
403
|
};
|