mall-components 1.0.0
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/README.md +128 -0
- package/build/_components-raw.css +791 -0
- package/build/_shims/antd.js +1 -0
- package/build/_shims/icons.js +1 -0
- package/build/_shims/moment.js +1 -0
- package/build/_shims/react-dom.js +1 -0
- package/build/_shims/react.js +1 -0
- package/build/adapters/DataSourceAdapter.d.ts +46 -0
- package/build/components/AdminLayout/AdminLayout.d.ts +5 -0
- package/build/components/AdminLayout/Breadcrumb.d.ts +8 -0
- package/build/components/AdminLayout/MainContent.d.ts +17 -0
- package/build/components/AdminLayout/Navbar.d.ts +10 -0
- package/build/components/AdminLayout/Sidebar.d.ts +14 -0
- package/build/components/AdminLayout/TabBar.d.ts +13 -0
- package/build/components/AdminLayout/TabPane.d.ts +4 -0
- package/build/components/AdminLayout/index.d.ts +3 -0
- package/build/components/AdminLayout/types.d.ts +42 -0
- package/build/components/CouponCard/CouponCard.d.ts +20 -0
- package/build/components/CouponCard/index.d.ts +1 -0
- package/build/components/OrderForm/OrderForm.d.ts +18 -0
- package/build/components/OrderForm/index.d.ts +1 -0
- package/build/components/OrderList/OrderList.d.ts +29 -0
- package/build/components/OrderList/index.d.ts +1 -0
- package/build/components/ProductForm/ProductForm.d.ts +18 -0
- package/build/components/ProductForm/index.d.ts +3 -0
- package/build/components/ProductList/ProductList.d.ts +47 -0
- package/build/components/ProductList/index.d.ts +3 -0
- package/build/components/PromotionCard/PromotionCard.d.ts +22 -0
- package/build/components/PromotionCard/index.d.ts +1 -0
- package/build/components/RoleCard/RoleCard.d.ts +18 -0
- package/build/components/RoleCard/index.d.ts +1 -0
- package/build/components/UserCard/UserCard.d.ts +17 -0
- package/build/components/UserCard/index.d.ts +1 -0
- package/build/entry-meta.d.ts +603 -0
- package/build/index.css +1 -0
- package/build/index.js +1 -0
- package/build/mall-components-meta.js +2563 -0
- package/build/mall-components.cdn.umd.css +1 -0
- package/build/mall-components.cdn.umd.js +8 -0
- package/build/mall-components.codesandbox.combined.js +1094 -0
- package/build/mall-components.codesandbox.css +401 -0
- package/build/mall-components.codesandbox.js +1080 -0
- package/build/mall-components.umd.css +1 -0
- package/build/mall-components.umd.js +8 -0
- package/build/meta/adminLayoutMeta.d.ts +3 -0
- package/build/meta/couponCardMeta.d.ts +128 -0
- package/build/meta/icons.d.ts +10 -0
- package/build/meta/orderFormMeta.d.ts +111 -0
- package/build/meta/orderListMeta.d.ts +170 -0
- package/build/meta/productFormMeta.d.ts +3 -0
- package/build/meta/productListMeta.d.ts +200 -0
- package/build/meta/promotionCardMeta.d.ts +129 -0
- package/build/meta/roleCardMeta.d.ts +3 -0
- package/build/meta/tabPaneMeta.d.ts +3 -0
- package/build/meta/userCardMeta.d.ts +3 -0
- package/build/meta.d.ts +605 -0
- package/build/setters/RestApiTester.d.ts +11 -0
- package/build/types/common.d.ts +17 -0
- package/build/types/marketing.d.ts +128 -0
- package/build/types/order.d.ts +174 -0
- package/build/types/permission.d.ts +101 -0
- package/build/types/product.d.ts +47 -0
- package/package.json +1 -0
- package/src/adapters/DataSourceAdapter.ts +445 -0
- package/src/components/AdminLayout/AdminLayout.scss +447 -0
- package/src/components/AdminLayout/AdminLayout.tsx +681 -0
- package/src/components/AdminLayout/Breadcrumb.tsx +60 -0
- package/src/components/AdminLayout/MainContent.tsx +54 -0
- package/src/components/AdminLayout/Navbar.tsx +76 -0
- package/src/components/AdminLayout/Sidebar.tsx +256 -0
- package/src/components/AdminLayout/TabBar.tsx +177 -0
- package/src/components/AdminLayout/TabPane.tsx +29 -0
- package/src/components/AdminLayout/index.ts +3 -0
- package/src/components/AdminLayout/types.ts +46 -0
- package/src/components/CouponCard/CouponCard.scss +55 -0
- package/src/components/CouponCard/CouponCard.tsx +687 -0
- package/src/components/CouponCard/index.ts +1 -0
- package/src/components/OrderForm/OrderForm.scss +148 -0
- package/src/components/OrderForm/OrderForm.tsx +503 -0
- package/src/components/OrderForm/index.ts +1 -0
- package/src/components/OrderList/OrderList.scss +160 -0
- package/src/components/OrderList/OrderList.tsx +885 -0
- package/src/components/OrderList/index.ts +1 -0
- package/src/components/ProductForm/ProductForm.scss +23 -0
- package/src/components/ProductForm/ProductForm.tsx +442 -0
- package/src/components/ProductForm/index.ts +3 -0
- package/src/components/ProductList/ProductList.scss +293 -0
- package/src/components/ProductList/ProductList.tsx +454 -0
- package/src/components/ProductList/index.ts +3 -0
- package/src/components/PromotionCard/PromotionCard.scss +71 -0
- package/src/components/PromotionCard/PromotionCard.tsx +579 -0
- package/src/components/PromotionCard/index.ts +1 -0
- package/src/components/RoleCard/RoleCard.scss +77 -0
- package/src/components/RoleCard/RoleCard.tsx +463 -0
- package/src/components/RoleCard/index.ts +1 -0
- package/src/components/UserCard/UserCard.scss +51 -0
- package/src/components/UserCard/UserCard.tsx +432 -0
- package/src/components/UserCard/index.ts +1 -0
- package/src/entry-components.ts +39 -0
- package/src/entry-meta.ts +23 -0
- package/src/index.scss +4 -0
- package/src/index.ts +36 -0
- package/src/index.tsx +17 -0
- package/src/meta/adminLayoutMeta.ts +154 -0
- package/src/meta/couponCardMeta.ts +287 -0
- package/src/meta/icons.ts +41 -0
- package/src/meta/orderFormMeta.ts +279 -0
- package/src/meta/orderListMeta.ts +443 -0
- package/src/meta/productFormMeta.ts +253 -0
- package/src/meta/productListMeta.ts +434 -0
- package/src/meta/promotionCardMeta.ts +276 -0
- package/src/meta/roleCardMeta.ts +142 -0
- package/src/meta/tabPaneMeta.ts +69 -0
- package/src/meta/userCardMeta.ts +128 -0
- package/src/meta.ts +25 -0
- package/src/setters/RestApiTester.tsx +219 -0
- package/src/shims/require.js +8 -0
- package/src/types/common.ts +19 -0
- package/src/types/marketing.ts +124 -0
- package/src/types/order.ts +169 -0
- package/src/types/permission.ts +102 -0
- package/src/types/product.ts +49 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { IPublicTypeComponentMetadata } from '@alilc/lowcode-types'
|
|
2
|
+
|
|
3
|
+
const AdminLayoutMeta: IPublicTypeComponentMetadata = {
|
|
4
|
+
componentName: 'AdminLayout',
|
|
5
|
+
title: '管理后台布局',
|
|
6
|
+
docUrl: 'https://github.com/alibaba/lowcode-engine',
|
|
7
|
+
screenshot: '',
|
|
8
|
+
npm: {
|
|
9
|
+
package: 'mall-components',
|
|
10
|
+
version: '1.0.0',
|
|
11
|
+
exportName: 'AdminLayout',
|
|
12
|
+
destructuring: true,
|
|
13
|
+
},
|
|
14
|
+
props: [
|
|
15
|
+
{
|
|
16
|
+
name: 'defaultSelectedKey',
|
|
17
|
+
propType: 'string',
|
|
18
|
+
description: '默认选中的菜单项',
|
|
19
|
+
defaultValue: 'dashboard',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'collapsible',
|
|
23
|
+
propType: 'bool',
|
|
24
|
+
description: '允许折叠侧边栏',
|
|
25
|
+
defaultValue: true,
|
|
26
|
+
setter: 'BoolSetter'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'enableTabs',
|
|
30
|
+
propType: 'bool',
|
|
31
|
+
description: '启用多标签页功能',
|
|
32
|
+
defaultValue: true,
|
|
33
|
+
setter: 'BoolSetter'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'maxTabs',
|
|
37
|
+
propType: 'number',
|
|
38
|
+
description: '最大标签页数量',
|
|
39
|
+
defaultValue: 10,
|
|
40
|
+
setter: 'NumberSetter'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'closableTabs',
|
|
44
|
+
propType: 'bool',
|
|
45
|
+
description: '标签页可关闭',
|
|
46
|
+
defaultValue: true,
|
|
47
|
+
setter: 'BoolSetter'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'logoText',
|
|
51
|
+
propType: 'string',
|
|
52
|
+
description: 'Logo 文字',
|
|
53
|
+
defaultValue: 'Mall Admin',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
configure: {
|
|
57
|
+
supports: {
|
|
58
|
+
style: true,
|
|
59
|
+
events: [],
|
|
60
|
+
loop: false,
|
|
61
|
+
},
|
|
62
|
+
props: [
|
|
63
|
+
{
|
|
64
|
+
type: 'group',
|
|
65
|
+
title: '布局配置',
|
|
66
|
+
display: 'accordion',
|
|
67
|
+
items: [
|
|
68
|
+
{
|
|
69
|
+
name: 'defaultSelectedKey',
|
|
70
|
+
title: '默认选中菜单',
|
|
71
|
+
setter: 'InputSetter',
|
|
72
|
+
extraProps: { display: 'block', placeholder: '例如:dashboard' }
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'collapsible',
|
|
76
|
+
title: '允许折叠侧边栏',
|
|
77
|
+
setter: 'BoolSetter',
|
|
78
|
+
extraProps: { display: 'block' }
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'logoText',
|
|
82
|
+
title: 'Logo 文字',
|
|
83
|
+
setter: 'InputSetter',
|
|
84
|
+
extraProps: { display: 'block' }
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: 'group',
|
|
90
|
+
title: '标签页配置',
|
|
91
|
+
display: 'accordion',
|
|
92
|
+
items: [
|
|
93
|
+
{
|
|
94
|
+
name: 'enableTabs',
|
|
95
|
+
title: '启用多标签页',
|
|
96
|
+
setter: 'BoolSetter',
|
|
97
|
+
extraProps: { display: 'block' }
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'maxTabs',
|
|
101
|
+
title: '最大标签数',
|
|
102
|
+
setter: 'NumberSetter',
|
|
103
|
+
extraProps: { display: 'block', min: 1, max: 20, step: 1 }
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'closableTabs',
|
|
107
|
+
title: '标签可关闭',
|
|
108
|
+
setter: 'BoolSetter',
|
|
109
|
+
extraProps: { display: 'block' }
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
component: {
|
|
115
|
+
isContainer: true,
|
|
116
|
+
nestingRule: {
|
|
117
|
+
childWhitelist: ['TabPane'],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
icon: 'https://img.alicdn.com/tfs/TB1p9Nqy.T1gK0jSZFrXXcNCXXa-200-200.png',
|
|
122
|
+
category: '电商业务组件',
|
|
123
|
+
group: '布局容器',
|
|
124
|
+
snippets: [
|
|
125
|
+
{
|
|
126
|
+
title: '管理后台布局(带 Tab)',
|
|
127
|
+
schema: {
|
|
128
|
+
componentName: 'AdminLayout',
|
|
129
|
+
props: {
|
|
130
|
+
defaultSelectedKey: 'dashboard',
|
|
131
|
+
collapsible: true,
|
|
132
|
+
enableTabs: true,
|
|
133
|
+
maxTabs: 10,
|
|
134
|
+
closableTabs: true,
|
|
135
|
+
logoText: 'Mall Admin',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
title: '管理后台布局(无 Tab)',
|
|
141
|
+
schema: {
|
|
142
|
+
componentName: 'AdminLayout',
|
|
143
|
+
props: {
|
|
144
|
+
defaultSelectedKey: 'dashboard',
|
|
145
|
+
collapsible: true,
|
|
146
|
+
enableTabs: false,
|
|
147
|
+
logoText: 'Mall Admin',
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export default AdminLayoutMeta
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import type { IPublicTypeComponentMetadata } from '@alilc/lowcode-types'
|
|
2
|
+
import { Icons } from './icons'
|
|
3
|
+
|
|
4
|
+
const defaultCouponMockData = {
|
|
5
|
+
code: 200,
|
|
6
|
+
message: 'success',
|
|
7
|
+
data: {
|
|
8
|
+
pageNum: 1,
|
|
9
|
+
pageSize: 10,
|
|
10
|
+
total: 3,
|
|
11
|
+
list: [
|
|
12
|
+
{
|
|
13
|
+
id: 1,
|
|
14
|
+
name: '新用户专享券',
|
|
15
|
+
type: 0,
|
|
16
|
+
platform: 0,
|
|
17
|
+
count: 1000,
|
|
18
|
+
amount: 50,
|
|
19
|
+
perLimit: 1,
|
|
20
|
+
minPoint: 200,
|
|
21
|
+
startTime: '2024-01-01',
|
|
22
|
+
endTime: '2024-12-31',
|
|
23
|
+
useType: 0,
|
|
24
|
+
note: '新用户首单满200减50',
|
|
25
|
+
publishCount: 500,
|
|
26
|
+
useCount: 320,
|
|
27
|
+
receiveCount: 450,
|
|
28
|
+
enableTime: '7',
|
|
29
|
+
code: 'NEWUSER50',
|
|
30
|
+
memberLevel: 0,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 2,
|
|
34
|
+
name: '限时折扣券',
|
|
35
|
+
type: 1,
|
|
36
|
+
platform: 3,
|
|
37
|
+
count: 500,
|
|
38
|
+
amount: 8,
|
|
39
|
+
perLimit: 2,
|
|
40
|
+
minPoint: 100,
|
|
41
|
+
startTime: '2024-01-15',
|
|
42
|
+
endTime: '2024-02-15',
|
|
43
|
+
useType: 1,
|
|
44
|
+
note: 'APP专享8折券',
|
|
45
|
+
publishCount: 300,
|
|
46
|
+
useCount: 180,
|
|
47
|
+
receiveCount: 280,
|
|
48
|
+
enableTime: '3',
|
|
49
|
+
code: 'APPDISCOUNT',
|
|
50
|
+
memberLevel: 1,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 3,
|
|
54
|
+
name: '会员专享券',
|
|
55
|
+
type: 0,
|
|
56
|
+
platform: 0,
|
|
57
|
+
count: 200,
|
|
58
|
+
amount: 100,
|
|
59
|
+
perLimit: 1,
|
|
60
|
+
minPoint: 500,
|
|
61
|
+
startTime: '2024-01-01',
|
|
62
|
+
endTime: '2024-06-30',
|
|
63
|
+
useType: 2,
|
|
64
|
+
note: '会员专享满500减100',
|
|
65
|
+
publishCount: 150,
|
|
66
|
+
useCount: 80,
|
|
67
|
+
receiveCount: 120,
|
|
68
|
+
enableTime: '15',
|
|
69
|
+
code: 'VIP100',
|
|
70
|
+
memberLevel: 2,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const couponCardMeta = {
|
|
77
|
+
componentName: 'CouponCard',
|
|
78
|
+
title: '优惠券管理',
|
|
79
|
+
docUrl: '',
|
|
80
|
+
screenshot: '',
|
|
81
|
+
devMode: 'proCode',
|
|
82
|
+
npm: {
|
|
83
|
+
package: 'mall-components',
|
|
84
|
+
version: '1.0.0',
|
|
85
|
+
exportName: 'CouponCard',
|
|
86
|
+
main: 'lib/index.js',
|
|
87
|
+
destructuring: true,
|
|
88
|
+
subName: '',
|
|
89
|
+
},
|
|
90
|
+
category: '电商业务',
|
|
91
|
+
group: '营销管理',
|
|
92
|
+
icon: Icons.gift,
|
|
93
|
+
props: [
|
|
94
|
+
{
|
|
95
|
+
name: 'dataSourceType',
|
|
96
|
+
propType: 'string',
|
|
97
|
+
description: '数据源类型',
|
|
98
|
+
defaultValue: 'mock',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'api',
|
|
102
|
+
propType: 'string',
|
|
103
|
+
description: 'API 地址',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'method',
|
|
107
|
+
propType: 'string',
|
|
108
|
+
description: '请求方法',
|
|
109
|
+
defaultValue: 'GET',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'mockData',
|
|
113
|
+
propType: 'string',
|
|
114
|
+
description: 'Mock 数据',
|
|
115
|
+
defaultValue: JSON.stringify(defaultCouponMockData),
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'variableName',
|
|
119
|
+
propType: 'string',
|
|
120
|
+
description: '变量名称',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'showCreateButton',
|
|
124
|
+
propType: 'bool',
|
|
125
|
+
description: '是否显示创建按钮',
|
|
126
|
+
defaultValue: true,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'showFilter',
|
|
130
|
+
propType: 'bool',
|
|
131
|
+
description: '是否显示筛选区域',
|
|
132
|
+
defaultValue: true,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'showStatistics',
|
|
136
|
+
propType: 'bool',
|
|
137
|
+
description: '是否显示统计信息',
|
|
138
|
+
defaultValue: true,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'style',
|
|
142
|
+
propType: 'object',
|
|
143
|
+
description: '自定义样式',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'className',
|
|
147
|
+
propType: 'string',
|
|
148
|
+
description: '自定义类名',
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
configure: {
|
|
152
|
+
supports: {
|
|
153
|
+
style: true,
|
|
154
|
+
className: true,
|
|
155
|
+
events: [
|
|
156
|
+
{ name: 'onCreateCoupon', description: '创建优惠券' },
|
|
157
|
+
{ name: 'onEditCoupon', description: '编辑优惠券' },
|
|
158
|
+
{ name: 'onDeleteCoupon', description: '删除优惠券' },
|
|
159
|
+
{ name: 'onSearch', description: '搜索' },
|
|
160
|
+
],
|
|
161
|
+
},
|
|
162
|
+
props: [
|
|
163
|
+
{
|
|
164
|
+
type: 'group',
|
|
165
|
+
title: '数据源配置',
|
|
166
|
+
display: 'accordion',
|
|
167
|
+
items: [
|
|
168
|
+
{
|
|
169
|
+
name: 'dataSourceType',
|
|
170
|
+
title: '数据源类型',
|
|
171
|
+
setter: {
|
|
172
|
+
componentName: 'SelectSetter',
|
|
173
|
+
props: {
|
|
174
|
+
options: [
|
|
175
|
+
{ label: 'Mock 数据', value: 'mock' },
|
|
176
|
+
{ label: '数据源绑定', value: 'variable' },
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
extraProps: {
|
|
181
|
+
display: 'block',
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'mockData',
|
|
186
|
+
title: 'Mock 数据 (JSON)',
|
|
187
|
+
setter: {
|
|
188
|
+
componentName: 'TextAreaSetter',
|
|
189
|
+
props: {
|
|
190
|
+
rows: 10,
|
|
191
|
+
placeholder: '请输入 JSON 格式的 Mock 数据',
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
extraProps: {
|
|
195
|
+
display: 'block',
|
|
196
|
+
},
|
|
197
|
+
condition: (target: any) => {
|
|
198
|
+
return target.getProps().getPropValue('dataSourceType') === 'mock'
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: 'dataSource',
|
|
203
|
+
title: '绑定数据源',
|
|
204
|
+
setter: {
|
|
205
|
+
componentName: 'MixedSetter',
|
|
206
|
+
props: {
|
|
207
|
+
setters: [
|
|
208
|
+
'JsonSetter',
|
|
209
|
+
'VariableSetter',
|
|
210
|
+
],
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
extraProps: {
|
|
214
|
+
display: 'block',
|
|
215
|
+
},
|
|
216
|
+
condition: (target: any) => {
|
|
217
|
+
return target.getProps().getPropValue('dataSourceType') === 'variable'
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
type: 'group',
|
|
224
|
+
title: '显示控制',
|
|
225
|
+
display: 'accordion',
|
|
226
|
+
items: [
|
|
227
|
+
{
|
|
228
|
+
name: 'showCreateButton',
|
|
229
|
+
title: '显示创建按钮',
|
|
230
|
+
setter: 'BoolSetter',
|
|
231
|
+
extraProps: {
|
|
232
|
+
display: 'block',
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: 'showFilter',
|
|
237
|
+
title: '显示筛选区域',
|
|
238
|
+
setter: 'BoolSetter',
|
|
239
|
+
extraProps: {
|
|
240
|
+
display: 'block',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'showStatistics',
|
|
245
|
+
title: '显示统计信息',
|
|
246
|
+
setter: 'BoolSetter',
|
|
247
|
+
extraProps: {
|
|
248
|
+
display: 'block',
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
],
|
|
252
|
+
},
|
|
253
|
+
],
|
|
254
|
+
},
|
|
255
|
+
snippets: [
|
|
256
|
+
{
|
|
257
|
+
title: '优惠券管理',
|
|
258
|
+
screenshot: '',
|
|
259
|
+
schema: {
|
|
260
|
+
componentName: 'CouponCard',
|
|
261
|
+
props: {
|
|
262
|
+
dataSourceType: 'mock',
|
|
263
|
+
mockData: JSON.stringify(defaultCouponMockData),
|
|
264
|
+
showCreateButton: true,
|
|
265
|
+
showFilter: true,
|
|
266
|
+
showStatistics: true,
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
title: '优惠券管理(简洁模式)',
|
|
272
|
+
screenshot: '',
|
|
273
|
+
schema: {
|
|
274
|
+
componentName: 'CouponCard',
|
|
275
|
+
props: {
|
|
276
|
+
dataSourceType: 'mock',
|
|
277
|
+
mockData: JSON.stringify(defaultCouponMockData),
|
|
278
|
+
showCreateButton: false,
|
|
279
|
+
showFilter: false,
|
|
280
|
+
showStatistics: false,
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export default couponCardMeta
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const getIconComponent = (iconName: string) => {
|
|
4
|
+
const icons = (window as any).icons;
|
|
5
|
+
if (!icons || !icons[iconName]) {
|
|
6
|
+
console.warn(`[MallComponents] Icon "${iconName}" not found in window.icons`);
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return icons[iconName];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Icons = {
|
|
13
|
+
get list() {
|
|
14
|
+
const Icon = getIconComponent('BarsOutlined');
|
|
15
|
+
return Icon ? React.createElement(Icon) : null;
|
|
16
|
+
},
|
|
17
|
+
get form() {
|
|
18
|
+
const Icon = getIconComponent('FormOutlined');
|
|
19
|
+
return Icon ? React.createElement(Icon) : null;
|
|
20
|
+
},
|
|
21
|
+
get gift() {
|
|
22
|
+
const Icon = getIconComponent('GiftOutlined');
|
|
23
|
+
return Icon ? React.createElement(Icon) : null;
|
|
24
|
+
},
|
|
25
|
+
get star() {
|
|
26
|
+
const Icon = getIconComponent('StarOutlined');
|
|
27
|
+
return Icon ? React.createElement(Icon) : null;
|
|
28
|
+
},
|
|
29
|
+
get user() {
|
|
30
|
+
const Icon = getIconComponent('UserOutlined');
|
|
31
|
+
return Icon ? React.createElement(Icon) : null;
|
|
32
|
+
},
|
|
33
|
+
get team() {
|
|
34
|
+
const Icon = getIconComponent('TeamOutlined');
|
|
35
|
+
return Icon ? React.createElement(Icon) : null;
|
|
36
|
+
},
|
|
37
|
+
get file() {
|
|
38
|
+
const Icon = getIconComponent('FileOutlined');
|
|
39
|
+
return Icon ? React.createElement(Icon) : null;
|
|
40
|
+
},
|
|
41
|
+
};
|