neo-cmp-cli 1.2.25 → 1.3.1
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 +90 -18
- package/package.json +1 -1
- package/src/template/antd-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/package.json +1 -1
- package/src/template/neo-custom-cmp-template/src/components/contact-form/index.tsx +20 -17
- package/src/template/neo-custom-cmp-template/src/components/contact-form/model.ts +7 -0
- package/src/template/neo-custom-cmp-template/src/components/object-form/README.md +176 -0
- package/src/template/neo-custom-cmp-template/src/components/object-form/index.tsx +612 -0
- package/src/template/neo-custom-cmp-template/src/components/object-form/model.ts +106 -0
- package/src/template/neo-custom-cmp-template/src/components/object-form/style.scss +370 -0
- package/src/template/neo-custom-cmp-template/src/components/xobject-table/index.tsx +2 -1
- 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
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
.object-form-container {
|
|
2
|
+
.form-header {
|
|
3
|
+
margin-bottom: 24px;
|
|
4
|
+
padding-bottom: 16px;
|
|
5
|
+
border-bottom: 1px solid #f0f0f0;
|
|
6
|
+
|
|
7
|
+
.form-title {
|
|
8
|
+
margin: 0;
|
|
9
|
+
font-size: 18px;
|
|
10
|
+
font-weight: 600;
|
|
11
|
+
color: #262626;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.form-content {
|
|
16
|
+
.ant-form {
|
|
17
|
+
.ant-form-item {
|
|
18
|
+
margin-bottom: 20px;
|
|
19
|
+
|
|
20
|
+
.ant-form-item-label {
|
|
21
|
+
padding-bottom: 6px;
|
|
22
|
+
|
|
23
|
+
label {
|
|
24
|
+
font-weight: 500;
|
|
25
|
+
color: #262626;
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
|
|
28
|
+
&::before {
|
|
29
|
+
display: inline-block;
|
|
30
|
+
margin-right: 4px;
|
|
31
|
+
color: #ff4d4f;
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
font-family: SimSun, sans-serif;
|
|
34
|
+
line-height: 1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ant-input,
|
|
40
|
+
.ant-select-selector,
|
|
41
|
+
.ant-input-number,
|
|
42
|
+
.ant-picker {
|
|
43
|
+
border-radius: 4px;
|
|
44
|
+
border: 1px solid #d9d9d9;
|
|
45
|
+
transition: all 0.3s;
|
|
46
|
+
|
|
47
|
+
&:hover {
|
|
48
|
+
border-color: #40a9ff;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:focus,
|
|
52
|
+
&.ant-input-focused,
|
|
53
|
+
&.ant-select-focused .ant-select-selector,
|
|
54
|
+
&.ant-picker-focused {
|
|
55
|
+
border-color: #40a9ff;
|
|
56
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ant-input-number {
|
|
61
|
+
width: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ant-input-textarea {
|
|
65
|
+
textarea {
|
|
66
|
+
resize: vertical;
|
|
67
|
+
min-height: 80px;
|
|
68
|
+
border-radius: 4px;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ant-picker {
|
|
73
|
+
width: 100%;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ant-select {
|
|
77
|
+
width: 100%;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// 错误提示样式
|
|
82
|
+
.ant-form-item-has-error {
|
|
83
|
+
.ant-input,
|
|
84
|
+
.ant-select-selector,
|
|
85
|
+
.ant-input-number,
|
|
86
|
+
.ant-picker {
|
|
87
|
+
border-color: #ff4d4f;
|
|
88
|
+
|
|
89
|
+
&:focus {
|
|
90
|
+
border-color: #ff4d4f;
|
|
91
|
+
box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.submit-success-message {
|
|
98
|
+
margin: 16px 0;
|
|
99
|
+
padding: 12px 16px;
|
|
100
|
+
background-color: #f6ffed;
|
|
101
|
+
border: 1px solid #b7eb8f;
|
|
102
|
+
border-radius: 4px;
|
|
103
|
+
color: #52c41a;
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
animation: fadeIn 0.3s ease-in;
|
|
108
|
+
|
|
109
|
+
.anticon {
|
|
110
|
+
margin-right: 8px;
|
|
111
|
+
font-size: 16px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.form-actions {
|
|
116
|
+
margin-top: 32px;
|
|
117
|
+
padding-top: 24px;
|
|
118
|
+
border-top: 1px solid #f0f0f0;
|
|
119
|
+
text-align: center;
|
|
120
|
+
|
|
121
|
+
.ant-space {
|
|
122
|
+
.ant-btn {
|
|
123
|
+
min-width: 100px;
|
|
124
|
+
height: 40px;
|
|
125
|
+
font-size: 15px;
|
|
126
|
+
border-radius: 4px;
|
|
127
|
+
font-weight: 500;
|
|
128
|
+
transition: all 0.3s;
|
|
129
|
+
|
|
130
|
+
&.ant-btn-primary {
|
|
131
|
+
background: #1890ff;
|
|
132
|
+
border-color: #1890ff;
|
|
133
|
+
|
|
134
|
+
&:hover {
|
|
135
|
+
background: #40a9ff;
|
|
136
|
+
border-color: #40a9ff;
|
|
137
|
+
transform: translateY(-2px);
|
|
138
|
+
box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&:active {
|
|
142
|
+
background: #096dd9;
|
|
143
|
+
border-color: #096dd9;
|
|
144
|
+
transform: translateY(0);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&:disabled {
|
|
148
|
+
background: #f5f5f5;
|
|
149
|
+
border-color: #d9d9d9;
|
|
150
|
+
color: rgba(0, 0, 0, 0.25);
|
|
151
|
+
transform: none;
|
|
152
|
+
box-shadow: none;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&:not(.ant-btn-primary) {
|
|
157
|
+
&:hover {
|
|
158
|
+
color: #40a9ff;
|
|
159
|
+
border-color: #40a9ff;
|
|
160
|
+
transform: translateY(-2px);
|
|
161
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&:active {
|
|
165
|
+
color: #096dd9;
|
|
166
|
+
border-color: #096dd9;
|
|
167
|
+
transform: translateY(0);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.ant-empty {
|
|
175
|
+
padding: 40px 0;
|
|
176
|
+
|
|
177
|
+
.ant-empty-description {
|
|
178
|
+
color: #8c8c8c;
|
|
179
|
+
font-size: 14px;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// 动画效果
|
|
185
|
+
@keyframes fadeIn {
|
|
186
|
+
from {
|
|
187
|
+
opacity: 0;
|
|
188
|
+
transform: translateY(-10px);
|
|
189
|
+
}
|
|
190
|
+
to {
|
|
191
|
+
opacity: 1;
|
|
192
|
+
transform: translateY(0);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// 响应式设计
|
|
197
|
+
@media (max-width: 768px) {
|
|
198
|
+
.form-header {
|
|
199
|
+
margin-bottom: 16px;
|
|
200
|
+
padding-bottom: 12px;
|
|
201
|
+
|
|
202
|
+
.form-title {
|
|
203
|
+
font-size: 16px;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.form-content {
|
|
208
|
+
.ant-form {
|
|
209
|
+
.ant-form-item {
|
|
210
|
+
margin-bottom: 16px;
|
|
211
|
+
|
|
212
|
+
.ant-form-item-label {
|
|
213
|
+
label {
|
|
214
|
+
font-size: 13px;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.ant-input,
|
|
219
|
+
.ant-select-selector,
|
|
220
|
+
.ant-input-number,
|
|
221
|
+
.ant-picker {
|
|
222
|
+
font-size: 14px;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.form-actions {
|
|
228
|
+
margin-top: 24px;
|
|
229
|
+
padding-top: 16px;
|
|
230
|
+
|
|
231
|
+
.ant-space {
|
|
232
|
+
.ant-btn {
|
|
233
|
+
min-width: 80px;
|
|
234
|
+
height: 36px;
|
|
235
|
+
font-size: 14px;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@media (max-width: 576px) {
|
|
243
|
+
.form-header {
|
|
244
|
+
.form-title {
|
|
245
|
+
font-size: 15px;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.form-content {
|
|
250
|
+
.ant-form {
|
|
251
|
+
// 在小屏幕上强制单列显示
|
|
252
|
+
.ant-row {
|
|
253
|
+
.ant-col {
|
|
254
|
+
max-width: 100% !important;
|
|
255
|
+
flex: 0 0 100% !important;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.ant-form-item {
|
|
260
|
+
margin-bottom: 14px;
|
|
261
|
+
|
|
262
|
+
.ant-form-item-label {
|
|
263
|
+
label {
|
|
264
|
+
font-size: 13px;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.form-actions {
|
|
271
|
+
.ant-space {
|
|
272
|
+
width: 100%;
|
|
273
|
+
|
|
274
|
+
.ant-space-item {
|
|
275
|
+
flex: 1;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.ant-btn {
|
|
279
|
+
width: 100%;
|
|
280
|
+
min-width: auto;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// 全局样式覆盖
|
|
289
|
+
.ant-card {
|
|
290
|
+
border-radius: 6px;
|
|
291
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
292
|
+
|
|
293
|
+
.ant-card-body {
|
|
294
|
+
padding: 24px;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Spin 加载样式
|
|
299
|
+
.ant-spin {
|
|
300
|
+
.ant-spin-dot {
|
|
301
|
+
font-size: 20px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.ant-spin-text {
|
|
305
|
+
color: #8c8c8c;
|
|
306
|
+
font-size: 14px;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Select 下拉样式优化
|
|
311
|
+
.ant-select-dropdown {
|
|
312
|
+
border-radius: 4px;
|
|
313
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
314
|
+
|
|
315
|
+
.ant-select-item {
|
|
316
|
+
padding: 8px 12px;
|
|
317
|
+
|
|
318
|
+
&:hover {
|
|
319
|
+
background-color: #f5f5f5;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
&.ant-select-item-option-selected {
|
|
323
|
+
background-color: #e6f7ff;
|
|
324
|
+
color: #1890ff;
|
|
325
|
+
font-weight: 500;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// DatePicker 日期选择器样式优化
|
|
331
|
+
.ant-picker-dropdown {
|
|
332
|
+
.ant-picker-panel-container {
|
|
333
|
+
border-radius: 4px;
|
|
334
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.ant-picker-cell-selected {
|
|
338
|
+
.ant-picker-cell-inner {
|
|
339
|
+
background-color: #1890ff;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.ant-picker-cell:hover:not(.ant-picker-cell-selected) {
|
|
344
|
+
.ant-picker-cell-inner {
|
|
345
|
+
background-color: #f5f5f5;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// InputNumber 数字输入框样式优化
|
|
351
|
+
.ant-input-number {
|
|
352
|
+
.ant-input-number-handler-wrap {
|
|
353
|
+
opacity: 0;
|
|
354
|
+
transition: opacity 0.3s;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
&:hover {
|
|
358
|
+
.ant-input-number-handler-wrap {
|
|
359
|
+
opacity: 1;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.ant-input-number-handler {
|
|
364
|
+
border-left: 1px solid #d9d9d9;
|
|
365
|
+
|
|
366
|
+
&:hover {
|
|
367
|
+
background-color: #f5f5f5;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
@@ -249,7 +249,8 @@ export default class XObjectTable extends React.PureComponent<
|
|
|
249
249
|
const { showEditButton, showDeleteButton, xObjectDataApi } = this.props;
|
|
250
250
|
const { fieldList } = this.state;
|
|
251
251
|
const { fields, fieldDescList } = xObjectDataApi || {};
|
|
252
|
-
let curFieldList =
|
|
252
|
+
let curFieldList =
|
|
253
|
+
fieldDescList && fieldDescList.length > 0 ? fieldDescList : fieldList;
|
|
253
254
|
|
|
254
255
|
if (fields && fields.length > 0) {
|
|
255
256
|
// 如果 fields 存在,则过滤掉 fieldList 中不存在的字段
|