@pisell/materials 1.0.977 → 1.0.979
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 +6 -6
- package/build/lowcode/preview.js +9 -9
- 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 +23 -23
- package/es/components/PisellProcedure/PisellProcedure.d.ts +27 -0
- package/es/components/PisellProcedure/components/ProcedureAction.d.ts +8 -0
- package/es/components/PisellProcedure/components/ProcedureContent.d.ts +8 -0
- package/es/components/PisellProcedure/components/ProcedureHeader.d.ts +8 -0
- package/es/components/PisellProcedure/components/ProcedureSummary.d.ts +8 -0
- package/es/components/PisellProcedure/hooks/useResponsive.d.ts +6 -0
- package/es/components/PisellProcedure/index.d.ts +4 -0
- package/es/components/PisellProcedure/types.d.ts +303 -0
- package/es/components/PisellSteps/PisellSteps.d.ts +14 -0
- package/es/components/PisellSteps/PisellSteps.js +170 -148
- package/es/components/PisellSteps/PisellSteps.less +248 -383
- package/es/components/PisellSteps/hooks/index.d.ts +4 -0
- package/es/components/PisellSteps/hooks/index.js +4 -0
- package/es/components/PisellSteps/hooks/useAnchor.d.ts +9 -0
- package/es/components/PisellSteps/hooks/useAnchor.js +55 -0
- package/es/components/PisellSteps/hooks/useResponsive.d.ts +8 -0
- package/es/components/PisellSteps/hooks/useResponsive.js +43 -0
- package/es/components/PisellSteps/hooks/useStepClick.d.ts +11 -0
- package/es/components/PisellSteps/hooks/useStepClick.js +35 -0
- package/es/components/PisellSteps/hooks/useStepsState.d.ts +9 -0
- package/es/components/PisellSteps/hooks/useStepsState.js +60 -0
- package/es/components/PisellSteps/index.d.ts +3 -0
- package/es/components/PisellSteps/index.js +2 -5
- package/es/components/PisellSteps/types.d.ts +271 -0
- package/es/components/PisellSteps/utils/index.d.ts +54 -0
- package/es/components/PisellSteps/utils/index.js +118 -0
- package/es/components/Template/PisellSteps.d.ts +0 -0
- package/es/components/Template/PisellSteps.js +1 -0
- package/es/components/Template/PisellSteps.less +1 -0
- package/es/components/Template/components/index.d.ts +0 -0
- package/es/components/Template/components/index.js +1 -0
- package/es/components/Template/hooks/index.d.ts +0 -0
- package/es/components/Template/hooks/index.js +1 -0
- package/es/components/Template/utils/index.d.ts +0 -0
- package/es/components/Template/utils/index.js +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +5 -5
- package/es/components/dataSourceComponents/dataSourceForm/urlUtils.d.ts +0 -10
- package/es/components/dataSourceComponents/dataSourceForm/urlUtils.js +13 -64
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +3 -4
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +101 -0
- package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +17 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +16 -0
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Switch/ReadPretty.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Switch/ReadPretty.js +16 -0
- package/es/components/dataSourceComponents/fields/Switch/ReadPretty.less +2 -0
- package/es/components/dataSourceComponents/fields/Switch/WithMode.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Switch/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/Switch/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Switch/index.js +8 -0
- package/es/components/dataSourceComponents/fields/Switch/type.d.ts +16 -0
- package/es/components/dataSourceComponents/fields/Switch/type.js +1 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +12 -12
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.d.ts +4 -0
- package/es/components/pisellCardList/index.d.ts +107 -0
- package/es/components/pisellGoodPassCard/index.d.ts +50 -0
- package/es/components/pisellWalletPassCard/index.d.ts +146 -0
- package/es/components/productCard/index.d.ts +7 -0
- package/es/index.d.ts +149 -0
- package/es/index.js +1 -1
- package/lib/components/PisellProcedure/PisellProcedure.d.ts +27 -0
- package/lib/components/PisellProcedure/components/ProcedureAction.d.ts +8 -0
- package/lib/components/PisellProcedure/components/ProcedureContent.d.ts +8 -0
- package/lib/components/PisellProcedure/components/ProcedureHeader.d.ts +8 -0
- package/lib/components/PisellProcedure/components/ProcedureSummary.d.ts +8 -0
- package/lib/components/PisellProcedure/hooks/useResponsive.d.ts +6 -0
- package/lib/components/PisellProcedure/index.d.ts +4 -0
- package/lib/components/PisellProcedure/types.d.ts +303 -0
- package/lib/components/PisellSteps/PisellSteps.d.ts +14 -0
- package/lib/components/PisellSteps/PisellSteps.js +155 -102
- package/lib/components/PisellSteps/PisellSteps.less +248 -383
- package/lib/components/PisellSteps/hooks/index.d.ts +4 -0
- package/lib/components/PisellSteps/hooks/index.js +38 -0
- package/lib/components/PisellSteps/hooks/useAnchor.d.ts +9 -0
- package/lib/components/PisellSteps/hooks/useAnchor.js +63 -0
- package/lib/components/PisellSteps/hooks/useResponsive.d.ts +8 -0
- package/lib/components/PisellSteps/hooks/useResponsive.js +48 -0
- package/lib/components/PisellSteps/hooks/useStepClick.d.ts +11 -0
- package/lib/components/PisellSteps/hooks/useStepClick.js +55 -0
- package/lib/components/PisellSteps/hooks/useStepsState.d.ts +9 -0
- package/lib/components/PisellSteps/hooks/useStepsState.js +54 -0
- package/lib/components/PisellSteps/index.d.ts +3 -0
- package/lib/components/PisellSteps/index.js +2 -7
- package/lib/components/PisellSteps/types.d.ts +271 -0
- package/lib/components/PisellSteps/utils/index.d.ts +54 -0
- package/lib/components/PisellSteps/utils/index.js +88 -0
- package/lib/components/Template/PisellSteps.d.ts +0 -0
- package/lib/components/Template/PisellSteps.js +0 -0
- package/lib/components/Template/PisellSteps.less +1 -0
- package/lib/components/Template/components/index.d.ts +0 -0
- package/lib/components/Template/components/index.js +0 -0
- package/lib/components/Template/hooks/index.d.ts +0 -0
- package/lib/components/Template/hooks/index.js +0 -0
- package/lib/components/Template/utils/index.d.ts +0 -0
- package/lib/components/Template/utils/index.js +0 -0
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +4 -4
- package/lib/components/dataSourceComponents/dataSourceForm/urlUtils.d.ts +0 -10
- package/lib/components/dataSourceComponents/dataSourceForm/urlUtils.js +3 -25
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +3 -3
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +101 -0
- package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +17 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +16 -0
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Switch/ReadPretty.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Switch/ReadPretty.js +52 -0
- package/lib/components/dataSourceComponents/fields/Switch/ReadPretty.less +2 -0
- package/lib/components/dataSourceComponents/fields/Switch/WithMode.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Switch/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Switch/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Switch/index.js +42 -0
- package/lib/components/dataSourceComponents/fields/Switch/type.d.ts +16 -0
- package/lib/components/dataSourceComponents/fields/Switch/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +12 -12
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.d.ts +4 -0
- package/lib/components/pisellCardList/index.d.ts +107 -0
- package/lib/components/pisellGoodPassCard/index.d.ts +50 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +146 -0
- package/lib/components/productCard/index.d.ts +7 -0
- package/lib/index.d.ts +149 -0
- package/lib/index.js +3 -3
- package/lowcode/data-source-form/constants.ts +3 -0
- package/lowcode/data-source-form/utils.ts +36 -7
- package/lowcode/form-item-switch/meta.ts +145 -0
- package/lowcode/form-item-switch/snippets.ts +15 -0
- package/lowcode/pisell-steps/meta.ts +621 -271
- package/lowcode/pisell-steps/snippets.ts +27 -69
- package/package.json +3 -3
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 计算当前步骤的进度百分比
|
|
3
|
+
*
|
|
4
|
+
* @param current - 当前步骤索引
|
|
5
|
+
* @param total - 总步骤数
|
|
6
|
+
* @returns 进度百分比(0-100)
|
|
7
|
+
*/
|
|
8
|
+
export function calculateProgress(current, total) {
|
|
9
|
+
if (total <= 0) return 0;
|
|
10
|
+
if (current < 0) return 0;
|
|
11
|
+
if (current >= total) return 100;
|
|
12
|
+
return Math.round((current + 1) / total * 100);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 判断步骤是否可点击
|
|
17
|
+
*
|
|
18
|
+
* @param index - 步骤索引
|
|
19
|
+
* @param current - 当前步骤索引
|
|
20
|
+
* @param status - 步骤状态
|
|
21
|
+
* @param clickable - 全局是否可点击
|
|
22
|
+
* @param allowClickFinished - 是否允许点击已完成步骤
|
|
23
|
+
* @returns 是否可点击
|
|
24
|
+
*/
|
|
25
|
+
export function isStepClickable(index, current, status, clickable, allowClickFinished) {
|
|
26
|
+
// 全局不允许点击
|
|
27
|
+
if (!clickable) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 当前步骤不可点击(避免重复触发)
|
|
32
|
+
if (index === current) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 已完成的步骤
|
|
37
|
+
if (status === 'finish' || index < current) {
|
|
38
|
+
return allowClickFinished;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 等待中的步骤默认不可点击
|
|
42
|
+
if (status === 'wait') {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 错误状态的步骤可以点击(用于修正)
|
|
47
|
+
if (status === 'error') {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 获取步骤状态
|
|
55
|
+
*
|
|
56
|
+
* @param index - 步骤索引
|
|
57
|
+
* @param current - 当前步骤索引
|
|
58
|
+
* @param customStatus - 自定义状态(优先级最高)
|
|
59
|
+
* @returns 步骤状态
|
|
60
|
+
*/
|
|
61
|
+
export function getStepStatus(index, current, customStatus) {
|
|
62
|
+
// 如果有自定义状态,直接返回
|
|
63
|
+
if (customStatus) {
|
|
64
|
+
return customStatus;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 根据索引和当前步骤判断状态
|
|
68
|
+
if (index < current) {
|
|
69
|
+
return 'finish';
|
|
70
|
+
} else if (index === current) {
|
|
71
|
+
return 'process';
|
|
72
|
+
} else {
|
|
73
|
+
return 'wait';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 合并步骤类名
|
|
79
|
+
*
|
|
80
|
+
* @param baseClass - 基础类名
|
|
81
|
+
* @param status - 步骤状态
|
|
82
|
+
* @param customClass - 自定义类名
|
|
83
|
+
* @returns 合并后的类名
|
|
84
|
+
*/
|
|
85
|
+
export function mergeStepClassName(baseClass, status, customClass) {
|
|
86
|
+
var classes = [baseClass];
|
|
87
|
+
|
|
88
|
+
// 添加状态类名
|
|
89
|
+
classes.push("".concat(baseClass, "-").concat(status));
|
|
90
|
+
|
|
91
|
+
// 添加自定义类名
|
|
92
|
+
if (customClass) {
|
|
93
|
+
classes.push(customClass);
|
|
94
|
+
}
|
|
95
|
+
return classes.join(' ');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* 判断步骤变更方向
|
|
100
|
+
*
|
|
101
|
+
* @param from - 原步骤索引
|
|
102
|
+
* @param to - 目标步骤索引
|
|
103
|
+
* @returns 变更方向
|
|
104
|
+
*/
|
|
105
|
+
export function getChangeDirection(from, to) {
|
|
106
|
+
return to > from ? 'forward' : 'backward';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 验证步骤索引是否有效
|
|
111
|
+
*
|
|
112
|
+
* @param index - 步骤索引
|
|
113
|
+
* @param total - 总步骤数
|
|
114
|
+
* @returns 是否有效
|
|
115
|
+
*/
|
|
116
|
+
export function isValidStepIndex(index, total) {
|
|
117
|
+
return index >= 0 && index < total;
|
|
118
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// 这里是组件的实现
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// 这里是组件的样式
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// 子组件
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// 自定义 hooks
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// 自定义工具函数
|
|
@@ -17,7 +17,7 @@ import useFormSetting from "../provider/hooks/useFormSetting";
|
|
|
17
17
|
import useCtxActions from "../../hooks/useCtxActions";
|
|
18
18
|
import useDataSource from "../../hooks/useDataSource";
|
|
19
19
|
import { filterSystemFields, setFormFieldsUntouched } from "../utils";
|
|
20
|
-
import {
|
|
20
|
+
import { getFormSettingParams } from "../urlUtils";
|
|
21
21
|
import "./index.less";
|
|
22
22
|
import { updateTenantSetting } from "../serve";
|
|
23
23
|
// 表单提交按钮
|
|
@@ -68,10 +68,10 @@ var SubmitButton = function SubmitButton(props) {
|
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
70
|
// 从URL查询字符串获取参数
|
|
71
|
-
urlParams =
|
|
72
|
-
business_code = urlParams.
|
|
73
|
-
channel_code = urlParams.
|
|
74
|
-
board_code = urlParams.isBoard
|
|
71
|
+
urlParams = getFormSettingParams();
|
|
72
|
+
business_code = urlParams.businessCode;
|
|
73
|
+
channel_code = urlParams.channelCode; // 只有当isBoard参数为1时才设置boardCode
|
|
74
|
+
board_code = urlParams.isBoard && business_code && channel_code ? "".concat(business_code, "+").concat(channel_code) : undefined;
|
|
75
75
|
_context.next = 9;
|
|
76
76
|
return updateTenantSetting({
|
|
77
77
|
business_code: business_code,
|
|
@@ -16,16 +16,6 @@ export declare const getFormSettingParams: (urlParams?: Record<string, string>)
|
|
|
16
16
|
channelCode: string;
|
|
17
17
|
isBoard: boolean;
|
|
18
18
|
};
|
|
19
|
-
/**
|
|
20
|
-
* 保存formSettingMeta数据
|
|
21
|
-
* @param sectionCodes 配置段代码数组,如 ['payment']
|
|
22
|
-
* @param data 要保存的数据
|
|
23
|
-
* @param businessCode 业务代码
|
|
24
|
-
* @param channelCode 渠道代码
|
|
25
|
-
* @param isBoard 是否包含board_code参数
|
|
26
|
-
* @returns Promise<any> 返回保存结果
|
|
27
|
-
*/
|
|
28
|
-
export declare const saveFormSettingMeta: (sectionCodes: string[], data: Record<string, any>, businessCode: string, channelCode: string, isBoard: boolean) => Promise<any>;
|
|
29
19
|
/**
|
|
30
20
|
* 根据URL参数更新租户设置数据
|
|
31
21
|
* @param data 要更新的数据对象,如 {"order.prefix":"","order.suffix":"","payment.number":""}
|
|
@@ -35,74 +35,23 @@ export var getFormSettingParams = function getFormSettingParams(urlParams) {
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
/**
|
|
39
|
-
* 保存formSettingMeta数据
|
|
40
|
-
* @param sectionCodes 配置段代码数组,如 ['payment']
|
|
41
|
-
* @param data 要保存的数据
|
|
42
|
-
* @param businessCode 业务代码
|
|
43
|
-
* @param channelCode 渠道代码
|
|
44
|
-
* @param isBoard 是否包含board_code参数
|
|
45
|
-
* @returns Promise<any> 返回保存结果
|
|
46
|
-
*/
|
|
47
|
-
export var saveFormSettingMeta = /*#__PURE__*/function () {
|
|
48
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sectionCodes, data, businessCode, channelCode, isBoard) {
|
|
49
|
-
var queryParams, url;
|
|
50
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
51
|
-
while (1) switch (_context.prev = _context.next) {
|
|
52
|
-
case 0:
|
|
53
|
-
// 构建查询参数
|
|
54
|
-
queryParams = new URLSearchParams(); // 添加section_code参数(支持多个值)
|
|
55
|
-
sectionCodes.forEach(function (code) {
|
|
56
|
-
queryParams.append('section_code[]', code);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// 添加business_code参数
|
|
60
|
-
if (businessCode) {
|
|
61
|
-
queryParams.append('business_code', businessCode);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// 添加channel_code参数
|
|
65
|
-
if (channelCode) {
|
|
66
|
-
queryParams.append('channel_code', channelCode);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// 当需要包含board_code时,格式为 business_code×channel_code
|
|
70
|
-
if (isBoard && businessCode && channelCode) {
|
|
71
|
-
queryParams.append('board_code', "".concat(businessCode, "\xD7").concat(channelCode));
|
|
72
|
-
}
|
|
73
|
-
url = "/setting?".concat(queryParams.toString());
|
|
74
|
-
return _context.abrupt("return", request.getRequest().post(url, data, {
|
|
75
|
-
headers: {
|
|
76
|
-
'Content-Type': 'application/json'
|
|
77
|
-
}
|
|
78
|
-
}));
|
|
79
|
-
case 7:
|
|
80
|
-
case "end":
|
|
81
|
-
return _context.stop();
|
|
82
|
-
}
|
|
83
|
-
}, _callee);
|
|
84
|
-
}));
|
|
85
|
-
return function saveFormSettingMeta(_x, _x2, _x3, _x4, _x5) {
|
|
86
|
-
return _ref.apply(this, arguments);
|
|
87
|
-
};
|
|
88
|
-
}();
|
|
89
|
-
|
|
90
38
|
/**
|
|
91
39
|
* 根据URL参数更新租户设置数据
|
|
92
40
|
* @param data 要更新的数据对象,如 {"order.prefix":"","order.suffix":"","payment.number":""}
|
|
93
41
|
* @returns Promise<any> 返回更新结果
|
|
94
42
|
*/
|
|
95
43
|
export var updateTenantSettingFromUrl = /*#__PURE__*/function () {
|
|
96
|
-
var
|
|
44
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
|
97
45
|
var urlParams, businessCode, channelCode, boardCode, requestBody, url;
|
|
98
|
-
return _regeneratorRuntime().wrap(function
|
|
99
|
-
while (1) switch (
|
|
46
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
47
|
+
while (1) switch (_context.prev = _context.next) {
|
|
100
48
|
case 0:
|
|
101
49
|
// 从URL获取参数
|
|
102
|
-
|
|
50
|
+
debugger;
|
|
51
|
+
urlParams = getFormSettingParams();
|
|
103
52
|
businessCode = urlParams.businessCode;
|
|
104
|
-
channelCode = urlParams.channelCode;
|
|
105
|
-
boardCode = urlParams.
|
|
53
|
+
channelCode = urlParams.channelCode;
|
|
54
|
+
boardCode = urlParams.isBoard && businessCode && channelCode ? "".concat(businessCode, "+").concat(channelCode) : undefined; // 构建请求体,按照 curl 请求的格式
|
|
106
55
|
requestBody = {
|
|
107
56
|
business_code: businessCode || '',
|
|
108
57
|
channel_code: channelCode || '',
|
|
@@ -110,18 +59,18 @@ export var updateTenantSettingFromUrl = /*#__PURE__*/function () {
|
|
|
110
59
|
data: data
|
|
111
60
|
};
|
|
112
61
|
url = '/tenant/setting';
|
|
113
|
-
return
|
|
62
|
+
return _context.abrupt("return", request.getRequest().post(url, requestBody, {
|
|
114
63
|
headers: {
|
|
115
64
|
'Content-Type': 'application/json'
|
|
116
65
|
}
|
|
117
66
|
}));
|
|
118
|
-
case
|
|
67
|
+
case 8:
|
|
119
68
|
case "end":
|
|
120
|
-
return
|
|
69
|
+
return _context.stop();
|
|
121
70
|
}
|
|
122
|
-
},
|
|
71
|
+
}, _callee);
|
|
123
72
|
}));
|
|
124
|
-
return function updateTenantSettingFromUrl(
|
|
125
|
-
return
|
|
73
|
+
return function updateTenantSettingFromUrl(_x) {
|
|
74
|
+
return _ref.apply(this, arguments);
|
|
126
75
|
};
|
|
127
76
|
}();
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormInstance } from 'antd';
|
|
3
|
+
import { ModeType } from './type';
|
|
4
|
+
import './style.less';
|
|
5
|
+
export interface WithModeProps {
|
|
6
|
+
renderMode?: ModeType;
|
|
7
|
+
value?: any;
|
|
8
|
+
onChange?: (value: any) => void;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @title: 增加renderMode属性
|
|
13
|
+
* @description: 基于renderMode属性控制渲染模式
|
|
14
|
+
* @return: *
|
|
15
|
+
* @Author: shengjie.zuo
|
|
16
|
+
* @Date: 2024-11-23 17:13:18
|
|
17
|
+
*/
|
|
18
|
+
export declare const withMode: <P extends object>(FieldComponent: React.ComponentType<P>, ReadPrettyComponent?: React.ComponentType<P & {
|
|
19
|
+
renderMode: ModeType;
|
|
20
|
+
}> | undefined, transformProps?: ((props: P, renderMode: ModeType) => P) | undefined) => React.FC<P & WithModeProps>;
|
|
21
|
+
export interface WithFormItemProps {
|
|
22
|
+
name: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
mode?: ModeType;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
27
|
+
export declare const formItemNameReplace: (name: string) => string;
|
|
28
|
+
export declare const formItemNameReverse: (name: string) => string;
|
|
29
|
+
export declare const isValidDomain: (value: string) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @title: 追加formItem层
|
|
32
|
+
* @description:
|
|
33
|
+
* @return: *
|
|
34
|
+
* @Author: shengjie.zuo
|
|
35
|
+
* @Date: 2024-11-23 17:14:25
|
|
36
|
+
*/
|
|
37
|
+
export declare const withFormItem: <P extends object>(WrappedComponent: React.ComponentType<P>, overlayProps?: {
|
|
38
|
+
otherFormItemProps?: Record<string, any> | ((props: Record<string, any>, others?: Record<string, any>) => Record<string, any>) | undefined;
|
|
39
|
+
innerProps?: Record<string, any> | undefined;
|
|
40
|
+
} | undefined) => React.FC<P & WithFormItemProps>;
|
|
41
|
+
export declare const withDataSource: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
|
|
42
|
+
dataSource?: any;
|
|
43
|
+
}) => JSX.Element;
|
|
44
|
+
export declare const withOptions: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
|
|
45
|
+
options?: any;
|
|
46
|
+
optionSourceType?: "custom" | "api" | "default" | undefined;
|
|
47
|
+
labelField: string;
|
|
48
|
+
valueField: string;
|
|
49
|
+
extraParams?: Record<string, any> | undefined;
|
|
50
|
+
}) => JSX.Element;
|
|
51
|
+
export declare const getNestedValue: (obj: Record<string, any>, path: string) => Record<string, any>;
|
|
52
|
+
export declare const renderValueWithMap: (value: any, valueMap?: Record<string, string>, renderMode?: ModeType) => JSX.Element | null;
|
|
53
|
+
export declare function toArr(str: string | number | (string | number)[]): (string | number)[];
|
|
54
|
+
export declare const filterSystemFields: (params: Record<string, any>) => Record<string, any>;
|
|
55
|
+
export declare const transformFormObjToArrayWithUntouched: (obj: Record<string, any>) => any[];
|
|
56
|
+
export declare const setFormFieldsUntouched: (form: FormInstance) => void;
|
|
@@ -138,11 +138,10 @@ export var withFormItem = function withFormItem(WrappedComponent, overlayProps)
|
|
|
138
138
|
var renderComponent = useMemo(function () {
|
|
139
139
|
var _overlayProps$innerPr;
|
|
140
140
|
// 使用renderMode属性,避免和组件mode冲突
|
|
141
|
-
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, otherProps, {
|
|
141
|
+
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.innerProps, otherProps, {
|
|
142
142
|
mode: propsMode,
|
|
143
|
-
renderMode: effectiveMode
|
|
144
|
-
|
|
145
|
-
style: _objectSpread(_objectSpread({}, innerStyle || {}), (overlayProps === null || overlayProps === void 0 || (_overlayProps$innerPr = overlayProps.innerProps) === null || _overlayProps$innerPr === void 0 ? void 0 : _overlayProps$innerPr.style) || {}),
|
|
143
|
+
renderMode: effectiveMode,
|
|
144
|
+
style: _objectSpread(_objectSpread({}, (overlayProps === null || overlayProps === void 0 || (_overlayProps$innerPr = overlayProps.innerProps) === null || _overlayProps$innerPr === void 0 ? void 0 : _overlayProps$innerPr.style) || {}), innerStyle || {}),
|
|
146
145
|
fieldKey: name,
|
|
147
146
|
isVerification: typeobj === null || typeobj === void 0 ? void 0 : typeobj.enabled,
|
|
148
147
|
size: size
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DataSourceTableProps } from '../type';
|
|
3
|
+
import { OperationItem } from '../type';
|
|
4
|
+
interface UseTablePropsProps {
|
|
5
|
+
data: any;
|
|
6
|
+
originProps: DataSourceTableProps;
|
|
7
|
+
openDrawer: (type: OperationItem) => void;
|
|
8
|
+
closeDrawer: () => void;
|
|
9
|
+
refreshData: () => void;
|
|
10
|
+
handleFilterChange: (changedFields: any, allFields: any) => void;
|
|
11
|
+
tableRef: any;
|
|
12
|
+
getInitialValues: () => Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 处理table的props
|
|
16
|
+
* 转换title
|
|
17
|
+
* @param props
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
21
|
+
currentComponentId: any;
|
|
22
|
+
title: string | number | boolean | JSX.Element | React.ReactFragment | (() => React.ReactNode) | null | undefined;
|
|
23
|
+
pagination: {
|
|
24
|
+
total: number;
|
|
25
|
+
current: number;
|
|
26
|
+
pageSize: number;
|
|
27
|
+
size: string;
|
|
28
|
+
showSizeChanger: boolean;
|
|
29
|
+
};
|
|
30
|
+
columns: import("./useColumns").Column[];
|
|
31
|
+
subTitle: string | number | boolean | JSX.Element | React.ReactFragment | (() => React.ReactNode) | null | undefined;
|
|
32
|
+
buttons: any[] | null;
|
|
33
|
+
filter: {
|
|
34
|
+
dom: any;
|
|
35
|
+
items: any;
|
|
36
|
+
} | null;
|
|
37
|
+
onRow: (record: any) => any;
|
|
38
|
+
actionButtons: any[] | null;
|
|
39
|
+
__id?: string | undefined;
|
|
40
|
+
currentSettingKey?: string | undefined;
|
|
41
|
+
titleButtons?: {
|
|
42
|
+
show: boolean;
|
|
43
|
+
maxCount: number;
|
|
44
|
+
items: OperationItem[];
|
|
45
|
+
} | undefined;
|
|
46
|
+
tableButtons?: {
|
|
47
|
+
show: boolean;
|
|
48
|
+
maxCount: number;
|
|
49
|
+
items: OperationItem[];
|
|
50
|
+
} | undefined;
|
|
51
|
+
operation?: {
|
|
52
|
+
show: boolean;
|
|
53
|
+
title: string;
|
|
54
|
+
width: number;
|
|
55
|
+
align: "center" | "left" | "right";
|
|
56
|
+
fixed: false | "left" | "right";
|
|
57
|
+
type: "link" | "button";
|
|
58
|
+
items: OperationItem[];
|
|
59
|
+
} | undefined;
|
|
60
|
+
operationContent?: {
|
|
61
|
+
[key: string]: React.ReactNode;
|
|
62
|
+
} | undefined;
|
|
63
|
+
dataSource: import("../../provider/dataSource/DataSourceContext").DataSourceType;
|
|
64
|
+
search?: {
|
|
65
|
+
show: boolean;
|
|
66
|
+
placeholder: string;
|
|
67
|
+
} | undefined;
|
|
68
|
+
__designMode: string;
|
|
69
|
+
componentId: string;
|
|
70
|
+
clickToDetail?: {
|
|
71
|
+
show: boolean;
|
|
72
|
+
useCustomAction: boolean;
|
|
73
|
+
actionType: string;
|
|
74
|
+
openMode: "modal" | "drawer";
|
|
75
|
+
openContentSize: "small" | "middle" | "large";
|
|
76
|
+
openTitle: string;
|
|
77
|
+
key: string;
|
|
78
|
+
} | undefined;
|
|
79
|
+
filterBy?: Record<string, any> | undefined;
|
|
80
|
+
sortBy: string;
|
|
81
|
+
tabs?: {
|
|
82
|
+
show: boolean;
|
|
83
|
+
type: string;
|
|
84
|
+
items: {
|
|
85
|
+
name: string;
|
|
86
|
+
filterBy: Record<string, any>;
|
|
87
|
+
sortBy: string;
|
|
88
|
+
}[];
|
|
89
|
+
} | undefined;
|
|
90
|
+
onValuesChange?: ((changedValues: any, values: any) => void) | undefined;
|
|
91
|
+
onDeleteFinish?: ((record: Record<string, any>) => void) | undefined;
|
|
92
|
+
extraParams?: {
|
|
93
|
+
list?: Record<string, any> | undefined;
|
|
94
|
+
get?: Record<string, any> | undefined;
|
|
95
|
+
update?: Record<string, any> | undefined;
|
|
96
|
+
create?: Record<string, any> | undefined;
|
|
97
|
+
destroy?: Record<string, any> | undefined;
|
|
98
|
+
} | undefined;
|
|
99
|
+
localSettings?: import("../../../table/types").LocalSettingsType | undefined;
|
|
100
|
+
};
|
|
101
|
+
export default useTableProps;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputProps } from 'antd';
|
|
3
|
+
import { ModeType } from '../../dataSourceForm/type';
|
|
4
|
+
declare type PhoneValue = string | {
|
|
5
|
+
phone: string;
|
|
6
|
+
countryCallingCode: string;
|
|
7
|
+
countryCode?: string;
|
|
8
|
+
};
|
|
9
|
+
export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
|
|
10
|
+
renderMode: ModeType;
|
|
11
|
+
value?: PhoneValue;
|
|
12
|
+
onChange?: (value: PhoneValue) => void;
|
|
13
|
+
returnFormat?: 'string' | 'object';
|
|
14
|
+
inputRef?: any;
|
|
15
|
+
}
|
|
16
|
+
declare const MobileNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
|
|
17
|
+
export default MobileNumberInputWithMode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputProps } from 'antd';
|
|
3
|
+
import { ModeType } from "../../dataSourceForm/type";
|
|
4
|
+
declare type PhoneValue = string | {
|
|
5
|
+
phone: string;
|
|
6
|
+
countryCallingCode: string;
|
|
7
|
+
};
|
|
8
|
+
export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
|
|
9
|
+
renderMode: ModeType;
|
|
10
|
+
value?: PhoneValue;
|
|
11
|
+
onChange?: (value: PhoneValue) => void;
|
|
12
|
+
returnFormat?: 'string' | 'object';
|
|
13
|
+
inputRef?: any;
|
|
14
|
+
}
|
|
15
|
+
declare const PhoneNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
|
|
16
|
+
export default PhoneNumberInputWithMode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const SelectWithDataSource: (props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps & {
|
|
2
2
|
options?: any;
|
|
3
|
-
optionSourceType?: "
|
|
3
|
+
optionSourceType?: "custom" | "api" | "default" | undefined;
|
|
4
4
|
labelField: string;
|
|
5
5
|
valueField: string;
|
|
6
6
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Iconfont from "../../../iconfont";
|
|
3
|
+
import "./ReadPretty.less";
|
|
4
|
+
var SwitchReadPretty = function SwitchReadPretty(props) {
|
|
5
|
+
var value = props.value,
|
|
6
|
+
checked = props.checked;
|
|
7
|
+
var isChecked = value !== undefined ? value : checked;
|
|
8
|
+
return isChecked ? /*#__PURE__*/React.createElement(Iconfont, {
|
|
9
|
+
type: "pisell2-check",
|
|
10
|
+
style: {
|
|
11
|
+
color: 'var(--theme-color)',
|
|
12
|
+
fontSize: 20
|
|
13
|
+
}
|
|
14
|
+
}) : null;
|
|
15
|
+
};
|
|
16
|
+
export default SwitchReadPretty;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface SwitchProps {
|
|
3
|
+
value?: boolean;
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
defaultChecked?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
size?: 'default' | 'small';
|
|
9
|
+
checkedChildren?: React.ReactNode;
|
|
10
|
+
unCheckedChildren?: React.ReactNode;
|
|
11
|
+
autoFocus?: boolean;
|
|
12
|
+
onChange?: (checked: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
onClick?: (checked: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
14
|
+
renderMode?: 'view' | 'edit' | 'disabled' | 'hidden';
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -34,7 +34,7 @@ declare const formFieldMap: {
|
|
|
34
34
|
};
|
|
35
35
|
FormItemSelect: (props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
36
36
|
options?: any;
|
|
37
|
-
optionSourceType?: "
|
|
37
|
+
optionSourceType?: "custom" | "api" | "default" | undefined;
|
|
38
38
|
labelField: string;
|
|
39
39
|
valueField: string;
|
|
40
40
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -59,7 +59,15 @@ declare const formFieldMap: {
|
|
|
59
59
|
FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
60
60
|
FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
61
61
|
};
|
|
62
|
-
declare const getFieldComponent: (fieldComponent: string) => (import("react").FC<
|
|
62
|
+
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<any> | ((props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps & {
|
|
63
|
+
options?: any;
|
|
64
|
+
optionSourceType?: "custom" | "api" | "default" | undefined;
|
|
65
|
+
labelField: string;
|
|
66
|
+
valueField: string;
|
|
67
|
+
extraParams?: Record<string, any> | undefined;
|
|
68
|
+
} & {
|
|
69
|
+
dataSource?: any;
|
|
70
|
+
}) => JSX.Element) | (import("react").FC<{}> & {
|
|
63
71
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
64
72
|
} & {
|
|
65
73
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -87,15 +95,7 @@ declare const getFieldComponent: (fieldComponent: string) => (import("react").FC
|
|
|
87
95
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
88
96
|
} & {
|
|
89
97
|
Group: import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
90
|
-
}) | ((
|
|
91
|
-
options?: any;
|
|
92
|
-
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
93
|
-
labelField: string;
|
|
94
|
-
valueField: string;
|
|
95
|
-
extraParams?: Record<string, any> | undefined;
|
|
96
|
-
} & {
|
|
97
|
-
dataSource?: any;
|
|
98
|
-
}) => JSX.Element) | import("react").FC<any> | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
|
|
98
|
+
}) | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
|
|
99
99
|
onChange: (value: string) => void;
|
|
100
|
-
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps
|
|
100
|
+
} & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
101
101
|
export { getFieldComponent, formFieldMap };
|