neo-cmp-cli 1.2.12 → 1.2.13
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/package.json +1 -1
- package/src/template/antd-custom-cmp-template/package.json +1 -1
- package/src/template/develop/neo-custom-cmp-template/package.json +1 -1
- package/src/template/echarts-custom-cmp-template/package.json +1 -1
- package/src/template/neo-custom-cmp-template/README.md +1 -1
- package/src/template/neo-custom-cmp-template/package.json +2 -2
- package/src/template/neo-custom-cmp-template/src/assets/img/detail.svg +1 -0
- package/src/template/neo-custom-cmp-template/src/components/contact-card-list/README.md +2 -7
- package/src/template/neo-custom-cmp-template/src/components/contact-card-list/index.tsx +13 -1
- package/src/template/neo-custom-cmp-template/src/components/contact-form/index.tsx +2 -3
- package/src/template/neo-custom-cmp-template/src/components/entity-detail/README.md +193 -0
- package/src/template/neo-custom-cmp-template/src/components/entity-detail/index.tsx +325 -0
- package/src/template/neo-custom-cmp-template/src/components/entity-detail/model.ts +125 -0
- package/src/template/neo-custom-cmp-template/src/components/entity-detail/style.scss +292 -0
- package/src/template/neo-custom-cmp-template/src/components/object-card-list/README.md +61 -0
- package/src/template/neo-custom-cmp-template/src/components/object-card-list/index.tsx +201 -0
- package/src/template/neo-custom-cmp-template/src/components/object-card-list/model.ts +66 -0
- package/src/template/neo-custom-cmp-template/src/components/object-card-list/style.scss +260 -0
- package/src/template/neo-custom-cmp-template/src/components/xobject-table/README.md +3 -11
- package/src/template/neo-custom-cmp-template/src/components/xobject-table/index.tsx +76 -58
- package/src/template/neo-custom-cmp-template/src/components/xobject-table/model.ts +21 -3
- package/src/template/react-custom-cmp-template/package.json +1 -1
- package/src/template/react-ts-custom-cmp-template/package.json +1 -1
- package/src/template/vue2-custom-cmp-template/package.json +1 -1
- package/src/template/neo-custom-cmp-template/src/components/xobject-table-v2/README.md +0 -108
- package/src/template/neo-custom-cmp-template/src/components/xobject-table-v2/index.tsx +0 -729
- package/src/template/neo-custom-cmp-template/src/components/xobject-table-v2/model.ts +0 -122
- package/src/template/neo-custom-cmp-template/src/components/xobject-table-v2/style.scss +0 -304
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file XObject 表格组件对接编辑器的描述文件
|
|
3
|
-
* @description 定义组件在 Neo 平台编辑器中的配置信息
|
|
4
|
-
* @author Neo Custom Widget CLI
|
|
5
|
-
* @version 1.0.0
|
|
6
|
-
*/
|
|
7
|
-
export class XObjectTableModel {
|
|
8
|
-
/**
|
|
9
|
-
* 组件类型标识
|
|
10
|
-
* 用于标识组件的唯一性,在构建时根据当前组件目录名称自动生成
|
|
11
|
-
* 注意:此字段在构建时会被自动替换,不需要手动设置
|
|
12
|
-
*/
|
|
13
|
-
// cmpType: string = 'xobject-table';
|
|
14
|
-
|
|
15
|
-
/** 组件名称,用于设置在编辑器左侧组件面板中展示的名称 */
|
|
16
|
-
label: string = '实体对象数据v2';
|
|
17
|
-
|
|
18
|
-
/** 组件描述,用于设置在编辑器左侧组件面板中展示的描述 */
|
|
19
|
-
description: string = '基于 XObject 的数据表格组件,支持增删改查操作';
|
|
20
|
-
|
|
21
|
-
/** 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签) */
|
|
22
|
-
tags: string[] = ['自定义组件'];
|
|
23
|
-
|
|
24
|
-
/** 组件图标,用于设置在编辑器左侧组件面板中展示的图标 */
|
|
25
|
-
iconSrc: string = 'https://custom-widgets.bj.bcebos.com/table.svg';
|
|
26
|
-
|
|
27
|
-
/** 初次插入页面的默认属性数据 */
|
|
28
|
-
defaultComProps = {
|
|
29
|
-
title: '实体数据表格',
|
|
30
|
-
xObjectApiKey: 'account',
|
|
31
|
-
showAddButton: true,
|
|
32
|
-
showEditButton: true,
|
|
33
|
-
showDeleteButton: true,
|
|
34
|
-
custom: true,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/** 设计器端预览时展示的默认数据 */
|
|
38
|
-
previewComProps = {
|
|
39
|
-
title: '实体数据表格',
|
|
40
|
-
xObjectApiKey: 'account',
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* 组件属性配置模式
|
|
45
|
-
* 支持静态配置:propsSchema,优先级比 propsSchemaCreator 低
|
|
46
|
-
* 定义组件在编辑器中可配置的属性
|
|
47
|
-
*/
|
|
48
|
-
propsSchema = [
|
|
49
|
-
{
|
|
50
|
-
type: 'select',
|
|
51
|
-
name: 'custom',
|
|
52
|
-
label: '实体类型',
|
|
53
|
-
value: true,
|
|
54
|
-
placeholder: '请选择要操作的实体类型',
|
|
55
|
-
options: [
|
|
56
|
-
{
|
|
57
|
-
label: '标准实体',
|
|
58
|
-
value: false,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
label: '自定义实体',
|
|
62
|
-
value: true,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
type: 'select',
|
|
68
|
-
name: 'xObjectApiKey',
|
|
69
|
-
label: '选择实体对象',
|
|
70
|
-
source: {
|
|
71
|
-
url: '/rest/metadata/v2.0/xobjects/filter?custom=${custom}&active=true',
|
|
72
|
-
method: 'GET',
|
|
73
|
-
adaptor: (resp: any) => {
|
|
74
|
-
const entityList = resp.data?.data?.records || [];
|
|
75
|
-
return {
|
|
76
|
-
status: 0,
|
|
77
|
-
data: {
|
|
78
|
-
options: entityList.map((item: any) => ({
|
|
79
|
-
label: item.label || item.name,
|
|
80
|
-
value: item.apiKey || item.name,
|
|
81
|
-
})),
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
searchable: true,
|
|
87
|
-
value: 'account',
|
|
88
|
-
placeholder: '请选择要操作的实体对象',
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
type: 'switch',
|
|
92
|
-
name: 'showAddButton',
|
|
93
|
-
label: '显示新增按钮',
|
|
94
|
-
value: true,
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
type: 'switch',
|
|
98
|
-
name: 'showEditButton',
|
|
99
|
-
label: '显示编辑按钮',
|
|
100
|
-
value: true,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
type: 'switch',
|
|
104
|
-
name: 'showDeleteButton',
|
|
105
|
-
label: '显示删除按钮',
|
|
106
|
-
value: true,
|
|
107
|
-
},
|
|
108
|
-
];
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* 支持函数式写法:propsSchemaCreator
|
|
112
|
-
* com 为组件实例,优先级比 propsSchema 高
|
|
113
|
-
* 可以根据组件实例动态生成属性配置
|
|
114
|
-
*/
|
|
115
|
-
/*
|
|
116
|
-
propsSchemaCreator = (com: any) => {
|
|
117
|
-
return [];
|
|
118
|
-
};
|
|
119
|
-
*/
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export default XObjectTableModel;
|
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
.xobject-table-container {
|
|
2
|
-
.table-header {
|
|
3
|
-
margin-bottom: 16px;
|
|
4
|
-
|
|
5
|
-
.header-content {
|
|
6
|
-
display: flex;
|
|
7
|
-
justify-content: space-between;
|
|
8
|
-
align-items: center;
|
|
9
|
-
flex-wrap: wrap;
|
|
10
|
-
gap: 12px;
|
|
11
|
-
|
|
12
|
-
.header-title {
|
|
13
|
-
margin: 0;
|
|
14
|
-
font-size: 18px;
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
color: #262626;
|
|
17
|
-
flex: 1;
|
|
18
|
-
min-width: 200px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.ant-space {
|
|
22
|
-
flex-shrink: 0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.table-content {
|
|
28
|
-
.ant-table {
|
|
29
|
-
.ant-table-thead > tr > th {
|
|
30
|
-
background-color: #fafafa;
|
|
31
|
-
font-weight: 600;
|
|
32
|
-
color: #262626;
|
|
33
|
-
border-bottom: 1px solid #f0f0f0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.ant-table-tbody > tr > td {
|
|
37
|
-
border-bottom: 1px solid #f0f0f0;
|
|
38
|
-
padding: 12px 16px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.ant-table-tbody > tr:hover > td {
|
|
42
|
-
background-color: #f5f5f5;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.ant-table-pagination {
|
|
46
|
-
margin-top: 16px;
|
|
47
|
-
text-align: right;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.ant-empty {
|
|
52
|
-
padding: 40px 0;
|
|
53
|
-
|
|
54
|
-
.ant-empty-description {
|
|
55
|
-
color: #8c8c8c;
|
|
56
|
-
font-size: 14px;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.error-container {
|
|
61
|
-
text-align: center;
|
|
62
|
-
padding: 40px 0;
|
|
63
|
-
|
|
64
|
-
.retry-button {
|
|
65
|
-
background: #1890ff;
|
|
66
|
-
border: 1px solid #1890ff;
|
|
67
|
-
color: #fff;
|
|
68
|
-
padding: 6px 15px;
|
|
69
|
-
border-radius: 4px;
|
|
70
|
-
cursor: pointer;
|
|
71
|
-
font-size: 14px;
|
|
72
|
-
transition: all 0.3s;
|
|
73
|
-
|
|
74
|
-
&:hover {
|
|
75
|
-
background: #40a9ff;
|
|
76
|
-
border-color: #40a9ff;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.ant-modal {
|
|
83
|
-
.ant-form {
|
|
84
|
-
.ant-form-item {
|
|
85
|
-
margin-bottom: 16px;
|
|
86
|
-
|
|
87
|
-
.ant-form-item-label {
|
|
88
|
-
padding-bottom: 4px;
|
|
89
|
-
|
|
90
|
-
label {
|
|
91
|
-
font-weight: 500;
|
|
92
|
-
color: #262626;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.ant-input,
|
|
97
|
-
.ant-select-selector,
|
|
98
|
-
.ant-input-number {
|
|
99
|
-
border-radius: 4px;
|
|
100
|
-
border: 1px solid #d9d9d9;
|
|
101
|
-
transition: all 0.3s;
|
|
102
|
-
|
|
103
|
-
&:hover {
|
|
104
|
-
border-color: #40a9ff;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
&:focus,
|
|
108
|
-
&.ant-input-focused,
|
|
109
|
-
&.ant-select-focused .ant-select-selector {
|
|
110
|
-
border-color: #40a9ff;
|
|
111
|
-
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.ant-input-textarea {
|
|
116
|
-
resize: vertical;
|
|
117
|
-
min-height: 80px;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.ant-btn {
|
|
124
|
-
border-radius: 4px;
|
|
125
|
-
font-weight: 500;
|
|
126
|
-
transition: all 0.3s;
|
|
127
|
-
|
|
128
|
-
&.ant-btn-primary {
|
|
129
|
-
background: #1890ff;
|
|
130
|
-
border-color: #1890ff;
|
|
131
|
-
|
|
132
|
-
&:hover {
|
|
133
|
-
background: #40a9ff;
|
|
134
|
-
border-color: #40a9ff;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
&:focus {
|
|
138
|
-
background: #40a9ff;
|
|
139
|
-
border-color: #40a9ff;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
&.ant-btn-link {
|
|
144
|
-
padding: 4px 8px;
|
|
145
|
-
height: auto;
|
|
146
|
-
line-height: 1.5;
|
|
147
|
-
|
|
148
|
-
&:hover {
|
|
149
|
-
background-color: #f5f5f5;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
&.ant-btn-link.ant-btn-dangerous {
|
|
154
|
-
color: #ff4d4f;
|
|
155
|
-
|
|
156
|
-
&:hover {
|
|
157
|
-
color: #ff7875;
|
|
158
|
-
background-color: #fff2f0;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.ant-popconfirm {
|
|
164
|
-
.ant-popover-inner-content {
|
|
165
|
-
padding: 12px 16px;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.ant-popover-buttons {
|
|
169
|
-
text-align: right;
|
|
170
|
-
margin-top: 8px;
|
|
171
|
-
|
|
172
|
-
.ant-btn {
|
|
173
|
-
margin-left: 8px;
|
|
174
|
-
|
|
175
|
-
&:first-child {
|
|
176
|
-
margin-left: 0;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.ant-spin {
|
|
183
|
-
.ant-spin-dot {
|
|
184
|
-
font-size: 20px;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.ant-spin-text {
|
|
188
|
-
color: #8c8c8c;
|
|
189
|
-
font-size: 14px;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// 响应式设计
|
|
194
|
-
@media (max-width: 768px) {
|
|
195
|
-
.table-header {
|
|
196
|
-
.header-content {
|
|
197
|
-
flex-direction: column;
|
|
198
|
-
align-items: flex-start;
|
|
199
|
-
|
|
200
|
-
.header-title {
|
|
201
|
-
margin-bottom: 8px;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.ant-space {
|
|
205
|
-
width: 100%;
|
|
206
|
-
justify-content: flex-end;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.table-content {
|
|
212
|
-
.ant-table {
|
|
213
|
-
.ant-table-thead > tr > th,
|
|
214
|
-
.ant-table-tbody > tr > td {
|
|
215
|
-
padding: 8px 12px;
|
|
216
|
-
font-size: 13px;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
@media (max-width: 576px) {
|
|
223
|
-
.table-header {
|
|
224
|
-
.header-content {
|
|
225
|
-
.header-title {
|
|
226
|
-
font-size: 16px;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.table-content {
|
|
232
|
-
.ant-table {
|
|
233
|
-
.ant-table-thead > tr > th,
|
|
234
|
-
.ant-table-tbody > tr > td {
|
|
235
|
-
padding: 6px 8px;
|
|
236
|
-
font-size: 12px;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.ant-table-pagination {
|
|
241
|
-
.ant-pagination-options {
|
|
242
|
-
display: none;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// 全局样式覆盖
|
|
250
|
-
.ant-card {
|
|
251
|
-
border-radius: 6px;
|
|
252
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
253
|
-
|
|
254
|
-
.ant-card-body {
|
|
255
|
-
padding: 20px;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.ant-modal {
|
|
260
|
-
.ant-modal-header {
|
|
261
|
-
border-bottom: 1px solid #f0f0f0;
|
|
262
|
-
padding: 16px 24px;
|
|
263
|
-
|
|
264
|
-
.ant-modal-title {
|
|
265
|
-
font-size: 16px;
|
|
266
|
-
font-weight: 600;
|
|
267
|
-
color: #262626;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.ant-modal-body {
|
|
272
|
-
padding: 24px;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.ant-modal-footer {
|
|
276
|
-
border-top: 1px solid #f0f0f0;
|
|
277
|
-
padding: 12px 24px;
|
|
278
|
-
text-align: right;
|
|
279
|
-
|
|
280
|
-
.ant-btn {
|
|
281
|
-
margin-left: 8px;
|
|
282
|
-
|
|
283
|
-
&:first-child {
|
|
284
|
-
margin-left: 0;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.ant-modal-content {
|
|
291
|
-
display: flex;
|
|
292
|
-
flex-direction: column;
|
|
293
|
-
|
|
294
|
-
.ant-modal-header,
|
|
295
|
-
.ant-modal-footer {
|
|
296
|
-
flex: 0;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
.ant-modal-body {
|
|
300
|
-
flex: 1;
|
|
301
|
-
max-height: 500px;
|
|
302
|
-
overflow-y: auto;
|
|
303
|
-
}
|
|
304
|
-
}
|