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,253 @@
|
|
|
1
|
+
import type { IPublicTypeComponentMetadata } from '@alilc/lowcode-types'
|
|
2
|
+
import { Icons } from './icons'
|
|
3
|
+
|
|
4
|
+
const ProductFormMeta: IPublicTypeComponentMetadata = {
|
|
5
|
+
componentName: 'ProductForm',
|
|
6
|
+
title: '商品表单',
|
|
7
|
+
docUrl: 'https://github.com/alibaba/lowcode-engine',
|
|
8
|
+
screenshot: '',
|
|
9
|
+
npm: {
|
|
10
|
+
package: 'mall-components',
|
|
11
|
+
version: '1.0.0',
|
|
12
|
+
exportName: 'ProductForm',
|
|
13
|
+
destructuring: true,
|
|
14
|
+
},
|
|
15
|
+
props: [
|
|
16
|
+
{
|
|
17
|
+
name: 'initialValues',
|
|
18
|
+
propType: 'string',
|
|
19
|
+
description: '表单初始值(JSON 格式)',
|
|
20
|
+
defaultValue: '{}',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'mode',
|
|
24
|
+
propType: 'string',
|
|
25
|
+
description: '表单模式',
|
|
26
|
+
defaultValue: 'create',
|
|
27
|
+
setter: {
|
|
28
|
+
componentName: 'SelectSetter',
|
|
29
|
+
props: {
|
|
30
|
+
options: [
|
|
31
|
+
{ label: '创建模式', value: 'create' },
|
|
32
|
+
{ label: '编辑模式', value: 'edit' },
|
|
33
|
+
{ label: '查看模式', value: 'view' },
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'showBasicInfo',
|
|
40
|
+
propType: 'bool',
|
|
41
|
+
description: '是否显示基本信息',
|
|
42
|
+
defaultValue: true,
|
|
43
|
+
setter: 'BoolSetter',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'showPriceInfo',
|
|
47
|
+
propType: 'bool',
|
|
48
|
+
description: '是否显示价格信息',
|
|
49
|
+
defaultValue: true,
|
|
50
|
+
setter: 'BoolSetter',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'showStockInfo',
|
|
54
|
+
propType: 'bool',
|
|
55
|
+
description: '是否显示库存信息',
|
|
56
|
+
defaultValue: true,
|
|
57
|
+
setter: 'BoolSetter',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'showStatusInfo',
|
|
61
|
+
propType: 'bool',
|
|
62
|
+
description: '是否显示状态信息',
|
|
63
|
+
defaultValue: true,
|
|
64
|
+
setter: 'BoolSetter',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'showDescription',
|
|
68
|
+
propType: 'bool',
|
|
69
|
+
description: '是否显示描述信息',
|
|
70
|
+
defaultValue: true,
|
|
71
|
+
setter: 'BoolSetter',
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
configure: {
|
|
75
|
+
supports: {
|
|
76
|
+
style: true,
|
|
77
|
+
events: [
|
|
78
|
+
{ name: 'onSubmit', description: '提交' },
|
|
79
|
+
{ name: 'onCancel', description: '取消' },
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
props: [
|
|
83
|
+
{
|
|
84
|
+
type: 'group',
|
|
85
|
+
title: '表单配置',
|
|
86
|
+
display: 'accordion',
|
|
87
|
+
items: [
|
|
88
|
+
{
|
|
89
|
+
name: 'mode',
|
|
90
|
+
title: '表单模式',
|
|
91
|
+
setter: {
|
|
92
|
+
componentName: 'SelectSetter',
|
|
93
|
+
props: {
|
|
94
|
+
options: [
|
|
95
|
+
{ label: '创建模式', value: 'create' },
|
|
96
|
+
{ label: '编辑模式', value: 'edit' },
|
|
97
|
+
{ label: '查看模式', value: 'view' },
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'initialValues',
|
|
104
|
+
title: '表单初始值',
|
|
105
|
+
setter: {
|
|
106
|
+
componentName: 'TextAreaSetter',
|
|
107
|
+
props: {
|
|
108
|
+
rows: 10,
|
|
109
|
+
placeholder: '请输入 JSON 格式的表单初始值',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
extraProps: {
|
|
113
|
+
display: 'block',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
type: 'group',
|
|
120
|
+
title: '标签页显示控制',
|
|
121
|
+
display: 'accordion',
|
|
122
|
+
items: [
|
|
123
|
+
{ name: 'showBasicInfo', title: '显示基本信息', setter: 'BoolSetter' },
|
|
124
|
+
{ name: 'showPriceInfo', title: '显示价格信息', setter: 'BoolSetter' },
|
|
125
|
+
{ name: 'showStockInfo', title: '显示库存信息', setter: 'BoolSetter' },
|
|
126
|
+
{ name: 'showStatusInfo', title: '显示状态信息', setter: 'BoolSetter' },
|
|
127
|
+
{ name: 'showDescription', title: '显示描述信息', setter: 'BoolSetter' },
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
icon: Icons.form,
|
|
133
|
+
category: '电商业务',
|
|
134
|
+
group: '商品管理',
|
|
135
|
+
snippets: [
|
|
136
|
+
{
|
|
137
|
+
title: '创建商品表单',
|
|
138
|
+
schema: {
|
|
139
|
+
componentName: 'ProductForm',
|
|
140
|
+
props: {
|
|
141
|
+
mode: 'create',
|
|
142
|
+
initialValues: '{}',
|
|
143
|
+
showBasicInfo: true,
|
|
144
|
+
showPriceInfo: true,
|
|
145
|
+
showStockInfo: true,
|
|
146
|
+
showStatusInfo: true,
|
|
147
|
+
showDescription: true,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
title: '编辑商品表单',
|
|
153
|
+
schema: {
|
|
154
|
+
componentName: 'ProductForm',
|
|
155
|
+
props: {
|
|
156
|
+
mode: 'edit',
|
|
157
|
+
initialValues: JSON.stringify({
|
|
158
|
+
id: 1,
|
|
159
|
+
name: '时尚运动鞋',
|
|
160
|
+
productSn: 'PRODUCT001',
|
|
161
|
+
price: 269,
|
|
162
|
+
stock: 100,
|
|
163
|
+
brandName: '时尚运动',
|
|
164
|
+
productCategoryName: '鞋子',
|
|
165
|
+
publishStatus: 1,
|
|
166
|
+
newStatus: 1,
|
|
167
|
+
recommandStatus: 1,
|
|
168
|
+
}, null, 2),
|
|
169
|
+
showBasicInfo: true,
|
|
170
|
+
showPriceInfo: true,
|
|
171
|
+
showStockInfo: true,
|
|
172
|
+
showStatusInfo: true,
|
|
173
|
+
showDescription: true,
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
title: '查看商品表单',
|
|
179
|
+
schema: {
|
|
180
|
+
componentName: 'ProductForm',
|
|
181
|
+
props: {
|
|
182
|
+
mode: 'view',
|
|
183
|
+
initialValues: JSON.stringify({
|
|
184
|
+
id: 1,
|
|
185
|
+
name: '时尚运动鞋',
|
|
186
|
+
productSn: 'PRODUCT001',
|
|
187
|
+
price: 269,
|
|
188
|
+
stock: 100,
|
|
189
|
+
brandName: '时尚运动',
|
|
190
|
+
productCategoryName: '鞋子',
|
|
191
|
+
publishStatus: 1,
|
|
192
|
+
newStatus: 1,
|
|
193
|
+
recommandStatus: 1,
|
|
194
|
+
description: '这是一款时尚的运动鞋,适合日常穿着。',
|
|
195
|
+
}, null, 2),
|
|
196
|
+
showBasicInfo: true,
|
|
197
|
+
showPriceInfo: true,
|
|
198
|
+
showStockInfo: true,
|
|
199
|
+
showStatusInfo: true,
|
|
200
|
+
showDescription: true,
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
title: '只读商品表单',
|
|
206
|
+
schema: {
|
|
207
|
+
componentName: 'ProductForm',
|
|
208
|
+
props: {
|
|
209
|
+
mode: 'view',
|
|
210
|
+
initialValues: JSON.stringify({
|
|
211
|
+
id: 1,
|
|
212
|
+
name: '时尚运动鞋',
|
|
213
|
+
productSn: 'PRODUCT001',
|
|
214
|
+
price: 269,
|
|
215
|
+
stock: 100,
|
|
216
|
+
sale: 120,
|
|
217
|
+
brandName: '时尚运动',
|
|
218
|
+
productCategoryName: '鞋子',
|
|
219
|
+
pic: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
|
220
|
+
publishStatus: 1,
|
|
221
|
+
newStatus: 1,
|
|
222
|
+
recommandStatus: 1,
|
|
223
|
+
verifyStatus: 1,
|
|
224
|
+
description: '这是一款时尚的运动鞋,适合日常穿着。',
|
|
225
|
+
note: '热销商品',
|
|
226
|
+
}, null, 2),
|
|
227
|
+
showBasicInfo: true,
|
|
228
|
+
showPriceInfo: true,
|
|
229
|
+
showStockInfo: true,
|
|
230
|
+
showStatusInfo: true,
|
|
231
|
+
showDescription: true,
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
title: '简洁商品表单',
|
|
237
|
+
schema: {
|
|
238
|
+
componentName: 'ProductForm',
|
|
239
|
+
props: {
|
|
240
|
+
mode: 'create',
|
|
241
|
+
initialValues: '{}',
|
|
242
|
+
showBasicInfo: true,
|
|
243
|
+
showPriceInfo: true,
|
|
244
|
+
showStockInfo: false,
|
|
245
|
+
showStatusInfo: false,
|
|
246
|
+
showDescription: false,
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export default ProductFormMeta
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import type { IPublicTypeComponentMetadata } from '@alilc/lowcode-types'
|
|
2
|
+
import { Icons } from './icons'
|
|
3
|
+
|
|
4
|
+
const defaultMockData = {
|
|
5
|
+
code: 200,
|
|
6
|
+
message: 'success',
|
|
7
|
+
data: {
|
|
8
|
+
pageNum: 1,
|
|
9
|
+
pageSize: 10,
|
|
10
|
+
total: 50,
|
|
11
|
+
list: [
|
|
12
|
+
{
|
|
13
|
+
id: 1,
|
|
14
|
+
name: '时尚运动鞋',
|
|
15
|
+
productSn: 'PRODUCT001',
|
|
16
|
+
price: 299,
|
|
17
|
+
stock: 100,
|
|
18
|
+
sale: 120,
|
|
19
|
+
brandName: '时尚运动',
|
|
20
|
+
productCategoryName: '鞋子',
|
|
21
|
+
pic: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
|
22
|
+
publishStatus: 1,
|
|
23
|
+
newStatus: 1,
|
|
24
|
+
recommandStatus: 1,
|
|
25
|
+
verifyStatus: 1,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 2,
|
|
29
|
+
name: '休闲T恤',
|
|
30
|
+
productSn: 'PRODUCT002',
|
|
31
|
+
price: 99,
|
|
32
|
+
stock: 200,
|
|
33
|
+
sale: 350,
|
|
34
|
+
brandName: '休闲服饰',
|
|
35
|
+
productCategoryName: '衣服',
|
|
36
|
+
pic: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
|
37
|
+
publishStatus: 1,
|
|
38
|
+
newStatus: 1,
|
|
39
|
+
recommandStatus: 0,
|
|
40
|
+
verifyStatus: 1,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 3,
|
|
44
|
+
name: '双肩背包',
|
|
45
|
+
productSn: 'PRODUCT003',
|
|
46
|
+
price: 189,
|
|
47
|
+
stock: 80,
|
|
48
|
+
sale: 80,
|
|
49
|
+
brandName: '旅行箱包',
|
|
50
|
+
productCategoryName: '配饰',
|
|
51
|
+
pic: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
|
52
|
+
publishStatus: 1,
|
|
53
|
+
newStatus: 0,
|
|
54
|
+
recommandStatus: 1,
|
|
55
|
+
verifyStatus: 1,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 4,
|
|
59
|
+
name: '运动手表',
|
|
60
|
+
productSn: 'PRODUCT004',
|
|
61
|
+
price: 499,
|
|
62
|
+
stock: 50,
|
|
63
|
+
sale: 60,
|
|
64
|
+
brandName: '智能数码',
|
|
65
|
+
productCategoryName: '数码',
|
|
66
|
+
pic: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
|
67
|
+
publishStatus: 1,
|
|
68
|
+
newStatus: 1,
|
|
69
|
+
recommandStatus: 1,
|
|
70
|
+
verifyStatus: 1,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 5,
|
|
74
|
+
name: '牛仔裤',
|
|
75
|
+
productSn: 'PRODUCT005',
|
|
76
|
+
price: 199,
|
|
77
|
+
stock: 150,
|
|
78
|
+
sale: 280,
|
|
79
|
+
brandName: '时尚牛仔',
|
|
80
|
+
productCategoryName: '衣服',
|
|
81
|
+
pic: 'https://img.yzcdn.cn/vant/cat.jpeg',
|
|
82
|
+
publishStatus: 1,
|
|
83
|
+
newStatus: 0,
|
|
84
|
+
recommandStatus: 0,
|
|
85
|
+
verifyStatus: 1,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export default {
|
|
92
|
+
componentName: 'ProductList',
|
|
93
|
+
title: '商品列表',
|
|
94
|
+
docUrl: 'https://github.com/alibaba/lowcode-engine',
|
|
95
|
+
screenshot: '',
|
|
96
|
+
npm: {
|
|
97
|
+
package: 'mall-components',
|
|
98
|
+
version: '1.0.0',
|
|
99
|
+
exportName: 'ProductList',
|
|
100
|
+
destructuring: true,
|
|
101
|
+
},
|
|
102
|
+
props: [
|
|
103
|
+
{
|
|
104
|
+
name: 'dataSourceType',
|
|
105
|
+
propType: 'string',
|
|
106
|
+
description: '数据源类型',
|
|
107
|
+
defaultValue: 'mock',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'api',
|
|
111
|
+
propType: 'string',
|
|
112
|
+
description: 'API 地址',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'method',
|
|
116
|
+
propType: 'string',
|
|
117
|
+
description: '请求方法',
|
|
118
|
+
defaultValue: 'GET',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'mockData',
|
|
122
|
+
propType: 'string',
|
|
123
|
+
description: 'Mock 数据',
|
|
124
|
+
defaultValue: JSON.stringify(defaultMockData),
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'variableName',
|
|
128
|
+
propType: 'string',
|
|
129
|
+
description: '变量名称',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'showFilter',
|
|
133
|
+
propType: 'bool',
|
|
134
|
+
description: '是否显示筛选搜索区域',
|
|
135
|
+
defaultValue: true,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'showAction',
|
|
139
|
+
propType: 'bool',
|
|
140
|
+
description: '是否显示操作区域',
|
|
141
|
+
defaultValue: true,
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'showSelection',
|
|
145
|
+
propType: 'bool',
|
|
146
|
+
description: '是否显示选择列',
|
|
147
|
+
defaultValue: true,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'showOperation',
|
|
151
|
+
propType: 'bool',
|
|
152
|
+
description: '是否显示操作列',
|
|
153
|
+
defaultValue: true,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'showStatus',
|
|
157
|
+
propType: 'bool',
|
|
158
|
+
description: '是否显示状态列',
|
|
159
|
+
defaultValue: true,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'showPagination',
|
|
163
|
+
propType: 'bool',
|
|
164
|
+
description: '是否显示分页区域',
|
|
165
|
+
defaultValue: true,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: 'actionButtons',
|
|
169
|
+
propType: 'array',
|
|
170
|
+
description: '操作按钮配置',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: 'batchOperations',
|
|
174
|
+
propType: 'array',
|
|
175
|
+
description: '批量操作配置',
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
configure: {
|
|
179
|
+
supports: {
|
|
180
|
+
style: true,
|
|
181
|
+
events: [
|
|
182
|
+
{ name: 'onRowClick', description: '行点击' },
|
|
183
|
+
{ name: 'onSearch', description: '搜索' },
|
|
184
|
+
{ name: 'onPageChange', description: '分页变化' },
|
|
185
|
+
{ name: 'onActionClick', description: '操作按钮点击' },
|
|
186
|
+
{ name: 'onBatchOperation', description: '批量操作' },
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
props: [
|
|
190
|
+
{
|
|
191
|
+
type: 'group',
|
|
192
|
+
title: '数据源配置',
|
|
193
|
+
display: 'accordion',
|
|
194
|
+
items: [
|
|
195
|
+
{
|
|
196
|
+
name: 'dataSourceType',
|
|
197
|
+
title: '数据源类型',
|
|
198
|
+
setter: {
|
|
199
|
+
componentName: 'SelectSetter',
|
|
200
|
+
props: {
|
|
201
|
+
options: [
|
|
202
|
+
{ label: 'Mock 数据', value: 'mock' },
|
|
203
|
+
{ label: '数据源绑定', value: 'variable' },
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
extraProps: {
|
|
208
|
+
display: 'block',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: 'mockData',
|
|
213
|
+
title: 'Mock 数据',
|
|
214
|
+
setter: {
|
|
215
|
+
componentName: 'TextAreaSetter',
|
|
216
|
+
props: {
|
|
217
|
+
rows: 10,
|
|
218
|
+
placeholder: '请输入 JSON 格式的 Mock 数据',
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
extraProps: {
|
|
222
|
+
display: 'block',
|
|
223
|
+
},
|
|
224
|
+
condition: (target: any) => {
|
|
225
|
+
return target.getProps().getPropValue('dataSourceType') === 'mock'
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: 'dataSource',
|
|
230
|
+
title: '绑定数据源',
|
|
231
|
+
setter: {
|
|
232
|
+
componentName: 'MixedSetter',
|
|
233
|
+
props: {
|
|
234
|
+
setters: [
|
|
235
|
+
'JsonSetter',
|
|
236
|
+
'VariableSetter',
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
extraProps: {
|
|
241
|
+
display: 'block',
|
|
242
|
+
},
|
|
243
|
+
condition: (target: any) => {
|
|
244
|
+
return target.getProps().getPropValue('dataSourceType') === 'variable'
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
type: 'group',
|
|
251
|
+
title: '区域显示控制',
|
|
252
|
+
display: 'accordion',
|
|
253
|
+
items: [
|
|
254
|
+
{ name: 'showFilter', title: '显示筛选区域', setter: 'BoolSetter', extraProps: { display: 'block' } },
|
|
255
|
+
{ name: 'showAction', title: '显示操作区域', setter: 'BoolSetter', extraProps: { display: 'block' } },
|
|
256
|
+
{ name: 'showSelection', title: '显示选择列', setter: 'BoolSetter', extraProps: { display: 'block' } },
|
|
257
|
+
{ name: 'showOperation', title: '显示操作列', setter: 'BoolSetter', extraProps: { display: 'block' } },
|
|
258
|
+
{ name: 'showStatus', title: '显示状态列', setter: 'BoolSetter', extraProps: { display: 'block' } },
|
|
259
|
+
{ name: 'showPagination', title: '显示分页', setter: 'BoolSetter', extraProps: { display: 'block' } },
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
type: 'group',
|
|
264
|
+
title: '操作配置',
|
|
265
|
+
display: 'accordion',
|
|
266
|
+
items: [
|
|
267
|
+
{
|
|
268
|
+
name: 'actionButtons',
|
|
269
|
+
title: '操作按钮',
|
|
270
|
+
setter: {
|
|
271
|
+
componentName: 'ArraySetter',
|
|
272
|
+
props: {
|
|
273
|
+
item: {
|
|
274
|
+
setters: [
|
|
275
|
+
{
|
|
276
|
+
componentName: 'ObjectSetter',
|
|
277
|
+
props: {
|
|
278
|
+
config: {
|
|
279
|
+
items: [
|
|
280
|
+
{ name: 'text', description: '按钮文本', setter: 'StringSetter' },
|
|
281
|
+
{
|
|
282
|
+
name: 'icon',
|
|
283
|
+
description: '图标',
|
|
284
|
+
setter: {
|
|
285
|
+
componentName: 'SelectSetter',
|
|
286
|
+
props: {
|
|
287
|
+
options: [
|
|
288
|
+
{ label: '加号', value: 'plus' },
|
|
289
|
+
{ label: '下载', value: 'download' },
|
|
290
|
+
{ label: '上传', value: 'upload' },
|
|
291
|
+
],
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
name: 'type',
|
|
297
|
+
description: '按钮类型',
|
|
298
|
+
setter: {
|
|
299
|
+
componentName: 'SelectSetter',
|
|
300
|
+
props: {
|
|
301
|
+
options: [
|
|
302
|
+
{ label: '主要按钮', value: 'primary' },
|
|
303
|
+
{ label: '默认按钮', value: 'default' },
|
|
304
|
+
{ label: '虚线按钮', value: 'dashed' },
|
|
305
|
+
{ label: '链接按钮', value: 'link' },
|
|
306
|
+
{ label: '文本按钮', value: 'text' },
|
|
307
|
+
],
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
{ name: 'onClick', description: '点击事件', setter: 'StringSetter' },
|
|
312
|
+
],
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
],
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
extraProps: {
|
|
321
|
+
display: 'block',
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: 'batchOperations',
|
|
326
|
+
title: '批量操作',
|
|
327
|
+
setter: {
|
|
328
|
+
componentName: 'ArraySetter',
|
|
329
|
+
props: {
|
|
330
|
+
item: {
|
|
331
|
+
setters: [
|
|
332
|
+
{
|
|
333
|
+
componentName: 'ObjectSetter',
|
|
334
|
+
props: {
|
|
335
|
+
config: {
|
|
336
|
+
items: [
|
|
337
|
+
{ name: 'text', description: '操作名称', setter: 'StringSetter' },
|
|
338
|
+
{ name: 'value', description: '操作值', setter: 'StringSetter' },
|
|
339
|
+
{ name: 'action', description: '操作动作', setter: 'StringSetter' },
|
|
340
|
+
],
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
],
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
extraProps: {
|
|
349
|
+
display: 'block',
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
],
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
},
|
|
356
|
+
icon: Icons.list,
|
|
357
|
+
category: '电商业务',
|
|
358
|
+
group: '商品管理',
|
|
359
|
+
snippets: [
|
|
360
|
+
{
|
|
361
|
+
title: '完整商品列表',
|
|
362
|
+
schema: {
|
|
363
|
+
componentName: 'ProductList',
|
|
364
|
+
props: {
|
|
365
|
+
dataSourceType: 'mock',
|
|
366
|
+
mockData: JSON.stringify(defaultMockData),
|
|
367
|
+
showFilter: true,
|
|
368
|
+
showAction: true,
|
|
369
|
+
showSelection: true,
|
|
370
|
+
showOperation: true,
|
|
371
|
+
showStatus: true,
|
|
372
|
+
showPagination: true,
|
|
373
|
+
actionButtons: [
|
|
374
|
+
{ text: '添加商品', icon: 'plus', type: 'primary', onClick: 'addProduct' },
|
|
375
|
+
{ text: '导出', icon: 'download', type: 'default' },
|
|
376
|
+
],
|
|
377
|
+
batchOperations: [
|
|
378
|
+
{ text: '批量上架', value: 'publishOn' },
|
|
379
|
+
{ text: '批量下架', value: 'publishOff' },
|
|
380
|
+
{ text: '批量删除', value: 'delete' },
|
|
381
|
+
],
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
title: '简洁商品列表',
|
|
387
|
+
schema: {
|
|
388
|
+
componentName: 'ProductList',
|
|
389
|
+
props: {
|
|
390
|
+
dataSourceType: 'mock',
|
|
391
|
+
mockData: JSON.stringify(defaultMockData),
|
|
392
|
+
showFilter: false,
|
|
393
|
+
showAction: false,
|
|
394
|
+
showSelection: false,
|
|
395
|
+
showOperation: false,
|
|
396
|
+
showStatus: false,
|
|
397
|
+
showPagination: true,
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
title: '只读商品列表',
|
|
403
|
+
schema: {
|
|
404
|
+
componentName: 'ProductList',
|
|
405
|
+
props: {
|
|
406
|
+
dataSourceType: 'mock',
|
|
407
|
+
mockData: JSON.stringify(defaultMockData),
|
|
408
|
+
showFilter: true,
|
|
409
|
+
showAction: false,
|
|
410
|
+
showSelection: false,
|
|
411
|
+
showOperation: false,
|
|
412
|
+
showStatus: true,
|
|
413
|
+
showPagination: true,
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
title: '纯搜索商品列表',
|
|
419
|
+
schema: {
|
|
420
|
+
componentName: 'ProductList',
|
|
421
|
+
props: {
|
|
422
|
+
dataSourceType: 'mock',
|
|
423
|
+
mockData: JSON.stringify(defaultMockData),
|
|
424
|
+
showFilter: true,
|
|
425
|
+
showAction: false,
|
|
426
|
+
showSelection: false,
|
|
427
|
+
showOperation: false,
|
|
428
|
+
showStatus: false,
|
|
429
|
+
showPagination: true,
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
},
|
|
433
|
+
],
|
|
434
|
+
}
|