neo-cmp-cli 1.8.3 → 1.8.6
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 +3 -3
- package/src/utils/cmpUtils/createCmpByTemplate.js +1 -1
- package/src/utils/projectUtils/createCmpProjectByTemplate.js +1 -1
- package/template/antd-custom-cmp-template/.prettierrc.js +12 -0
- package/template/antd-custom-cmp-template/README.md +153 -0
- package/template/antd-custom-cmp-template/commitlint.config.js +59 -0
- package/template/antd-custom-cmp-template/neo.config.js +144 -0
- package/template/antd-custom-cmp-template/package.json +60 -0
- package/template/antd-custom-cmp-template/public/css/base.css +283 -0
- package/template/antd-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
- package/template/antd-custom-cmp-template/public/template.html +13 -0
- package/template/antd-custom-cmp-template/src/assets/css/common.scss +127 -0
- package/template/antd-custom-cmp-template/src/assets/css/mixin.scss +47 -0
- package/template/antd-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
- package/template/antd-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
- package/template/antd-custom-cmp-template/src/assets/img/favicon.png +0 -0
- package/template/antd-custom-cmp-template/src/components/dataDashboard/README.md +39 -0
- package/template/antd-custom-cmp-template/src/components/dataDashboard/index.tsx +462 -0
- package/template/antd-custom-cmp-template/src/components/dataDashboard/model.ts +75 -0
- package/template/antd-custom-cmp-template/src/components/dataDashboard/style.scss +1667 -0
- package/template/antd-custom-cmp-template/src/components/infoCard/index.tsx +87 -0
- package/template/antd-custom-cmp-template/src/components/infoCard/model.ts +80 -0
- package/template/antd-custom-cmp-template/src/components/infoCard/style.scss +105 -0
- package/template/antd-custom-cmp-template/tsconfig.json +68 -0
- package/template/develop/neo-custom-cmp-template/.prettierrc.js +12 -0
- package/template/develop/neo-custom-cmp-template/README.md +48 -0
- package/template/develop/neo-custom-cmp-template/commitlint.config.js +59 -0
- package/template/develop/neo-custom-cmp-template/docs/README.md +13 -0
- package/template/develop/neo-custom-cmp-template/neo.config.js +121 -0
- package/template/develop/neo-custom-cmp-template/package.json +63 -0
- package/template/develop/neo-custom-cmp-template/public/css/base.css +283 -0
- package/template/develop/neo-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
- package/template/develop/neo-custom-cmp-template/public/template.html +13 -0
- package/template/develop/neo-custom-cmp-template/src/assets/css/common.scss +127 -0
- package/template/develop/neo-custom-cmp-template/src/assets/css/mixin.scss +47 -0
- package/template/develop/neo-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
- package/template/develop/neo-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
- package/template/develop/neo-custom-cmp-template/src/assets/img/favicon.png +0 -0
- package/template/develop/neo-custom-cmp-template/src/assets/img/table.svg +1 -0
- package/template/develop/neo-custom-cmp-template/src/components/contactCardList/README.md +65 -0
- package/template/develop/neo-custom-cmp-template/src/components/contactCardList/index.tsx +180 -0
- package/template/develop/neo-custom-cmp-template/src/components/contactCardList/model.ts +50 -0
- package/template/develop/neo-custom-cmp-template/src/components/contactCardList/style.scss +260 -0
- package/template/develop/neo-custom-cmp-template/src/components/contactForm/README.md +94 -0
- package/template/develop/neo-custom-cmp-template/src/components/contactForm/index.tsx +251 -0
- package/template/develop/neo-custom-cmp-template/src/components/contactForm/model.ts +56 -0
- package/template/develop/neo-custom-cmp-template/src/components/contactForm/style.scss +120 -0
- package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/README.md +115 -0
- package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/index.tsx +304 -0
- package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/model.ts +87 -0
- package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/style.scss +127 -0
- package/template/develop/neo-custom-cmp-template/src/utils/axiosFetcher.ts +29 -0
- package/template/develop/neo-custom-cmp-template/src/utils/queryObjectData.ts +39 -0
- package/template/develop/neo-custom-cmp-template/src/utils/xobjects.ts +203 -0
- package/template/develop/neo-custom-cmp-template/tsconfig.json +68 -0
- package/template/echarts-custom-cmp-template/.prettierrc.js +12 -0
- package/template/echarts-custom-cmp-template/README.md +198 -0
- package/template/echarts-custom-cmp-template/commitlint.config.js +59 -0
- package/template/echarts-custom-cmp-template/neo.config.js +140 -0
- package/template/echarts-custom-cmp-template/package.json +61 -0
- package/template/echarts-custom-cmp-template/public/css/base.css +283 -0
- package/template/echarts-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
- package/template/echarts-custom-cmp-template/public/template.html +13 -0
- package/template/echarts-custom-cmp-template/src/assets/css/common.scss +127 -0
- package/template/echarts-custom-cmp-template/src/assets/css/mixin.scss +47 -0
- package/template/echarts-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
- package/template/echarts-custom-cmp-template/src/assets/img/chart.svg +1 -0
- package/template/echarts-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
- package/template/echarts-custom-cmp-template/src/assets/img/favicon.png +0 -0
- package/template/echarts-custom-cmp-template/src/components/chartWidget/README.md +186 -0
- package/template/echarts-custom-cmp-template/src/components/chartWidget/index.tsx +724 -0
- package/template/echarts-custom-cmp-template/src/components/chartWidget/model.ts +151 -0
- package/template/echarts-custom-cmp-template/src/components/chartWidget/style.scss +209 -0
- package/template/echarts-custom-cmp-template/src/components/mapWidget/README.md +125 -0
- package/template/echarts-custom-cmp-template/src/components/mapWidget/USAGE.md +190 -0
- package/template/echarts-custom-cmp-template/src/components/mapWidget/index.tsx +385 -0
- package/template/echarts-custom-cmp-template/src/components/mapWidget/model.ts +107 -0
- package/template/echarts-custom-cmp-template/src/components/mapWidget/style.scss +192 -0
- package/template/echarts-custom-cmp-template/src/utils/url.ts +82 -0
- package/template/echarts-custom-cmp-template/tsconfig.json +68 -0
- package/template/empty-cmp/index.tsx +58 -0
- package/template/empty-cmp/model.ts +79 -0
- package/template/empty-cmp/style.scss +72 -0
- package/template/empty-custom-cmp-template/.prettierrc.js +12 -0
- package/template/empty-custom-cmp-template/README.md +154 -0
- package/template/empty-custom-cmp-template/commitlint.config.js +59 -0
- package/template/empty-custom-cmp-template/neo.config.js +138 -0
- package/template/empty-custom-cmp-template/package.json +58 -0
- package/template/empty-custom-cmp-template/public/css/base.css +283 -0
- package/template/empty-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
- package/template/empty-custom-cmp-template/public/template.html +13 -0
- package/template/empty-custom-cmp-template/src/assets/css/common.scss +127 -0
- package/template/empty-custom-cmp-template/src/assets/css/mixin.scss +47 -0
- package/template/empty-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
- package/template/empty-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
- package/template/empty-custom-cmp-template/src/assets/img/favicon.png +0 -0
- package/template/empty-custom-cmp-template/src/assets/img/map.svg +1 -0
- package/template/empty-custom-cmp-template/src/components/README.md +3 -0
- package/template/empty-custom-cmp-template/tsconfig.json +68 -0
- package/template/neo-custom-cmp-template/.prettierrc.js +12 -0
- package/template/neo-custom-cmp-template/README.md +155 -0
- package/template/neo-custom-cmp-template/commitlint.config.js +59 -0
- package/template/neo-custom-cmp-template/docs/README.md +244 -0
- package/template/neo-custom-cmp-template/neo.config.js +140 -0
- package/template/neo-custom-cmp-template/package.json +66 -0
- package/template/neo-custom-cmp-template/public/css/base.css +283 -0
- package/template/neo-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
- package/template/neo-custom-cmp-template/public/template.html +13 -0
- package/template/neo-custom-cmp-template/src/assets/css/common.scss +127 -0
- package/template/neo-custom-cmp-template/src/assets/css/mixin.scss +47 -0
- package/template/neo-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
- package/template/neo-custom-cmp-template/src/assets/img/card-list.svg +1 -0
- package/template/neo-custom-cmp-template/src/assets/img/contact-form.svg +1 -0
- package/template/neo-custom-cmp-template/src/assets/img/custom-form.svg +1 -0
- package/template/neo-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
- package/template/neo-custom-cmp-template/src/assets/img/data-list.svg +1 -0
- package/template/neo-custom-cmp-template/src/assets/img/detail.svg +1 -0
- package/template/neo-custom-cmp-template/src/assets/img/table.svg +1 -0
- package/template/neo-custom-cmp-template/src/components/entityCardList/README.md +61 -0
- package/template/neo-custom-cmp-template/src/components/entityCardList/index.tsx +202 -0
- package/template/neo-custom-cmp-template/src/components/entityCardList/model.ts +74 -0
- package/template/neo-custom-cmp-template/src/components/entityCardList/style.scss +260 -0
- package/template/neo-custom-cmp-template/src/components/entityDetail/README.md +176 -0
- package/template/neo-custom-cmp-template/src/components/entityDetail/index.tsx +334 -0
- package/template/neo-custom-cmp-template/src/components/entityDetail/model.ts +123 -0
- package/template/neo-custom-cmp-template/src/components/entityDetail/style.scss +292 -0
- package/template/neo-custom-cmp-template/src/components/entityForm/README.md +176 -0
- package/template/neo-custom-cmp-template/src/components/entityForm/index.tsx +615 -0
- package/template/neo-custom-cmp-template/src/components/entityForm/model.ts +107 -0
- package/template/neo-custom-cmp-template/src/components/entityForm/style.scss +370 -0
- package/template/neo-custom-cmp-template/src/components/entityTable/README.md +92 -0
- package/template/neo-custom-cmp-template/src/components/entityTable/index.tsx +784 -0
- package/template/neo-custom-cmp-template/src/components/entityTable/model.ts +134 -0
- package/template/neo-custom-cmp-template/src/components/entityTable/style.scss +304 -0
- package/template/neo-custom-cmp-template/src/utils/axiosFetcher.ts +37 -0
- package/template/neo-custom-cmp-template/src/utils/queryObjectData.ts +76 -0
- package/template/neo-custom-cmp-template/src/utils/xobjects.ts +162 -0
- package/template/neo-custom-cmp-template/tsconfig.json +49 -0
- package/template/react-custom-cmp-template/.prettierrc.js +12 -0
- package/template/react-custom-cmp-template/README.md +154 -0
- package/template/react-custom-cmp-template/commitlint.config.js +59 -0
- package/template/react-custom-cmp-template/neo.config.js +137 -0
- package/template/react-custom-cmp-template/package.json +57 -0
- package/template/react-custom-cmp-template/public/css/base.css +283 -0
- package/template/react-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
- package/template/react-custom-cmp-template/public/template.html +13 -0
- package/template/react-custom-cmp-template/src/assets/css/common.scss +127 -0
- package/template/react-custom-cmp-template/src/assets/css/mixin.scss +47 -0
- package/template/react-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
- package/template/react-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
- package/template/react-custom-cmp-template/src/assets/img/favicon.png +0 -0
- package/template/react-custom-cmp-template/src/components/infoCard/index.jsx +45 -0
- package/template/react-custom-cmp-template/src/components/infoCard/model.js +81 -0
- package/template/react-custom-cmp-template/src/components/infoCard/style.scss +67 -0
- package/template/react-ts-custom-cmp-template/.prettierrc.js +12 -0
- package/template/react-ts-custom-cmp-template/README.md +154 -0
- package/template/react-ts-custom-cmp-template/commitlint.config.js +59 -0
- package/template/react-ts-custom-cmp-template/neo.config.js +138 -0
- package/template/react-ts-custom-cmp-template/package.json +59 -0
- package/template/react-ts-custom-cmp-template/public/css/base.css +283 -0
- package/template/react-ts-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
- package/template/react-ts-custom-cmp-template/public/template.html +13 -0
- package/template/react-ts-custom-cmp-template/src/assets/css/common.scss +127 -0
- package/template/react-ts-custom-cmp-template/src/assets/css/mixin.scss +47 -0
- package/template/react-ts-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
- package/template/react-ts-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
- package/template/react-ts-custom-cmp-template/src/assets/img/favicon.png +0 -0
- package/template/react-ts-custom-cmp-template/src/assets/img/map.svg +1 -0
- package/template/react-ts-custom-cmp-template/src/components/listWidget/README.md +2 -0
- package/template/react-ts-custom-cmp-template/src/components/listWidget/index.tsx +208 -0
- package/template/react-ts-custom-cmp-template/src/components/listWidget/model.ts +92 -0
- package/template/react-ts-custom-cmp-template/src/components/listWidget/style.scss +350 -0
- package/template/react-ts-custom-cmp-template/tsconfig.json +68 -0
- package/template/vue2-custom-cmp-template/.prettierrc.js +12 -0
- package/template/vue2-custom-cmp-template/README.md +154 -0
- package/template/vue2-custom-cmp-template/commitlint.config.js +59 -0
- package/template/vue2-custom-cmp-template/neo.config.js +146 -0
- package/template/vue2-custom-cmp-template/package.json +59 -0
- package/template/vue2-custom-cmp-template/public/css/base.css +283 -0
- package/template/vue2-custom-cmp-template/public/scripts/app/bluebird.js +6679 -0
- package/template/vue2-custom-cmp-template/public/template.html +13 -0
- package/template/vue2-custom-cmp-template/src/assets/css/common.scss +126 -0
- package/template/vue2-custom-cmp-template/src/assets/css/mixin.scss +47 -0
- package/template/vue2-custom-cmp-template/src/assets/img/NeoCRM.jpg +0 -0
- package/template/vue2-custom-cmp-template/src/assets/img/custom-widget.svg +1 -0
- package/template/vue2-custom-cmp-template/src/assets/img/favicon.png +0 -0
- package/template/vue2-custom-cmp-template/src/components/vueInfoCard/index.vue +131 -0
- package/template/vue2-custom-cmp-template/src/components/vueInfoCard/model.js +81 -0
- package/test/deprecate-versions.js +1 -1
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
.entity-detail-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
height: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
margin: 6px 12px;
|
|
8
|
+
padding: 16px;
|
|
9
|
+
background-color: #fff;
|
|
10
|
+
border-radius: 8px;
|
|
11
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
12
|
+
|
|
13
|
+
.detail-header {
|
|
14
|
+
flex-shrink: 0;
|
|
15
|
+
margin-bottom: 16px;
|
|
16
|
+
|
|
17
|
+
.header-content {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 16px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.header-title {
|
|
25
|
+
margin: 0 !important;
|
|
26
|
+
font-family: PingFangSC-Medium, -apple-system, BlinkMacSystemFont,
|
|
27
|
+
'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
28
|
+
font-size: 18px;
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
line-height: 1.4;
|
|
31
|
+
color: #262626;
|
|
32
|
+
flex: 1;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 8px;
|
|
36
|
+
|
|
37
|
+
.title-icon {
|
|
38
|
+
color: #1890ff;
|
|
39
|
+
font-size: 20px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.refresh-button {
|
|
44
|
+
flex-shrink: 0;
|
|
45
|
+
border-radius: 6px;
|
|
46
|
+
font-size: 13px;
|
|
47
|
+
height: 32px;
|
|
48
|
+
padding: 4px 12px;
|
|
49
|
+
box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
|
|
50
|
+
transition: all 0.3s ease;
|
|
51
|
+
|
|
52
|
+
&:hover {
|
|
53
|
+
box-shadow: 0 4px 8px rgba(24, 144, 255, 0.3);
|
|
54
|
+
transform: translateY(-1px);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:active {
|
|
58
|
+
transform: translateY(0);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.anticon {
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.detail-content {
|
|
68
|
+
flex: 1;
|
|
69
|
+
overflow-y: auto;
|
|
70
|
+
overflow-x: hidden;
|
|
71
|
+
|
|
72
|
+
.error-container {
|
|
73
|
+
display: flex;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
align-items: center;
|
|
76
|
+
min-height: 300px;
|
|
77
|
+
padding: 20px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.detail-column-card {
|
|
81
|
+
height: 100%;
|
|
82
|
+
background: #fafafa;
|
|
83
|
+
border-radius: 8px;
|
|
84
|
+
|
|
85
|
+
.ant-card-body {
|
|
86
|
+
padding: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ant-descriptions {
|
|
90
|
+
background: transparent;
|
|
91
|
+
|
|
92
|
+
&.ant-descriptions-bordered {
|
|
93
|
+
.ant-descriptions-item-label {
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
background-color: #f5f5f5;
|
|
96
|
+
color: #262626;
|
|
97
|
+
font-size: 14px;
|
|
98
|
+
padding: 12px 16px;
|
|
99
|
+
border-right: 1px solid #e8e8e8;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ant-descriptions-item-content {
|
|
103
|
+
background-color: #ffffff;
|
|
104
|
+
color: #595959;
|
|
105
|
+
font-size: 14px;
|
|
106
|
+
padding: 12px 16px;
|
|
107
|
+
word-break: break-word;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ant-descriptions-row {
|
|
111
|
+
border-bottom: 1px solid #e8e8e8;
|
|
112
|
+
|
|
113
|
+
&:last-child {
|
|
114
|
+
border-bottom: none;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// 空状态样式
|
|
123
|
+
.ant-empty {
|
|
124
|
+
padding: 60px 20px;
|
|
125
|
+
|
|
126
|
+
.ant-empty-description {
|
|
127
|
+
color: #8c8c8c;
|
|
128
|
+
font-size: 14px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Tag 样式优化
|
|
133
|
+
.ant-tag {
|
|
134
|
+
margin: 0;
|
|
135
|
+
border-radius: 4px;
|
|
136
|
+
font-size: 13px;
|
|
137
|
+
padding: 2px 8px;
|
|
138
|
+
line-height: 20px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// 链接样式
|
|
142
|
+
a {
|
|
143
|
+
color: #1890ff;
|
|
144
|
+
text-decoration: none;
|
|
145
|
+
transition: color 0.3s;
|
|
146
|
+
|
|
147
|
+
&:hover {
|
|
148
|
+
color: #40a9ff;
|
|
149
|
+
text-decoration: underline;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&:active {
|
|
153
|
+
color: #096dd9;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// 响应式设计
|
|
158
|
+
@media (max-width: 1200px) {
|
|
159
|
+
.detail-content {
|
|
160
|
+
.ant-col-md-8 {
|
|
161
|
+
max-width: 50%;
|
|
162
|
+
flex: 0 0 50%;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@media (max-width: 768px) {
|
|
168
|
+
margin: 4px 8px;
|
|
169
|
+
padding: 12px;
|
|
170
|
+
|
|
171
|
+
.detail-header {
|
|
172
|
+
margin-bottom: 12px;
|
|
173
|
+
|
|
174
|
+
.header-content {
|
|
175
|
+
gap: 12px;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.header-title {
|
|
179
|
+
font-size: 16px;
|
|
180
|
+
|
|
181
|
+
.title-icon {
|
|
182
|
+
font-size: 18px;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.refresh-button {
|
|
187
|
+
height: 28px;
|
|
188
|
+
padding: 2px 8px;
|
|
189
|
+
font-size: 12px;
|
|
190
|
+
|
|
191
|
+
.anticon {
|
|
192
|
+
font-size: 11px;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.detail-content {
|
|
198
|
+
.ant-col-md-8,
|
|
199
|
+
.ant-col-md-12 {
|
|
200
|
+
max-width: 100%;
|
|
201
|
+
flex: 0 0 100%;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.detail-column-card {
|
|
205
|
+
margin-bottom: 16px;
|
|
206
|
+
|
|
207
|
+
.ant-descriptions {
|
|
208
|
+
&.ant-descriptions-bordered {
|
|
209
|
+
.ant-descriptions-item-label,
|
|
210
|
+
.ant-descriptions-item-content {
|
|
211
|
+
font-size: 13px;
|
|
212
|
+
padding: 10px 12px;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@media (max-width: 480px) {
|
|
221
|
+
margin: 2px 4px;
|
|
222
|
+
padding: 8px;
|
|
223
|
+
|
|
224
|
+
.detail-header {
|
|
225
|
+
.header-content {
|
|
226
|
+
flex-direction: column;
|
|
227
|
+
align-items: stretch;
|
|
228
|
+
gap: 8px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.header-title {
|
|
232
|
+
font-size: 15px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.refresh-button {
|
|
236
|
+
width: 100%;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.detail-content {
|
|
241
|
+
.detail-column-card {
|
|
242
|
+
.ant-descriptions {
|
|
243
|
+
&.ant-descriptions-bordered {
|
|
244
|
+
.ant-descriptions-item-label,
|
|
245
|
+
.ant-descriptions-item-content {
|
|
246
|
+
font-size: 12px;
|
|
247
|
+
padding: 8px 10px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.ant-descriptions-item-label {
|
|
251
|
+
width: 30%;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// 加载状态样式
|
|
261
|
+
.ant-spin-container {
|
|
262
|
+
min-height: 200px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.ant-spin-nested-loading {
|
|
266
|
+
> div > .ant-spin {
|
|
267
|
+
max-height: none;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// 自定义滚动条样式
|
|
272
|
+
.entity-detail-container .detail-content {
|
|
273
|
+
&::-webkit-scrollbar {
|
|
274
|
+
width: 6px;
|
|
275
|
+
height: 6px;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
&::-webkit-scrollbar-track {
|
|
279
|
+
background: #f0f0f0;
|
|
280
|
+
border-radius: 3px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
&::-webkit-scrollbar-thumb {
|
|
284
|
+
background: #bfbfbf;
|
|
285
|
+
border-radius: 3px;
|
|
286
|
+
transition: background 0.3s;
|
|
287
|
+
|
|
288
|
+
&:hover {
|
|
289
|
+
background: #8c8c8c;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Object Form 对象表单组件
|
|
2
|
+
|
|
3
|
+
基于 XObject 的对象表单组件,专门用于新增对象数据,支持动态字段渲染和多种字段类型。
|
|
4
|
+
备注:使用 Neo Open API SDK(neo-open-api)提供的方法实现数据对象的新增操作。
|
|
5
|
+
|
|
6
|
+
## 功能特性
|
|
7
|
+
|
|
8
|
+
- 📝 **动态表单渲染**:根据 XObject 字段描述自动生成表单项
|
|
9
|
+
- ➕ **数据新增**:支持向 Neo 平台新增数据记录
|
|
10
|
+
- 🎨 **多种字段类型**:支持文本、数字、日期、下拉选择等多种字段类型
|
|
11
|
+
- 📐 **响应式布局**:支持单列和双列布局,适配不同屏幕尺寸
|
|
12
|
+
- ✅ **表单验证**:自动根据字段配置进行必填验证
|
|
13
|
+
- 🔄 **表单重置**:支持快速重置表单内容
|
|
14
|
+
- 🎯 **成功提示**:提交成功后显示友好的提示信息
|
|
15
|
+
- ⚙️ **属性配置**:支持通过编辑器配置组件属性
|
|
16
|
+
|
|
17
|
+
## 组件属性
|
|
18
|
+
|
|
19
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
20
|
+
|--------|------|--------|------|
|
|
21
|
+
| formTitle | string | '新增数据' | 表单标题 |
|
|
22
|
+
| xObjectDataApi | object | - | 实体数据源配置,包含 xObjectApiKey 和 fields |
|
|
23
|
+
| xObjectDataApi.xObjectApiKey | string | '' | 数据对象的 API Key |
|
|
24
|
+
| xObjectDataApi.fields | string[] | [] | 要显示的字段列表(可选,不传则显示所有字段) |
|
|
25
|
+
| columnCount | 1 \| 2 | 1 | 表单列数(1列或2列) |
|
|
26
|
+
| showResetButton | boolean | true | 是否显示重置按钮 |
|
|
27
|
+
| onSuccess | function | - | 提交成功后的回调函数 |
|
|
28
|
+
|
|
29
|
+
## 使用方法
|
|
30
|
+
|
|
31
|
+
### 1. 在编辑器中使用
|
|
32
|
+
|
|
33
|
+
1. 从组件面板拖拽 "对象表单" 组件到页面
|
|
34
|
+
2. 在右侧属性面板中选择要操作的数据对象
|
|
35
|
+
3. 选择要在表单中显示的字段
|
|
36
|
+
4. 配置表单标题、列数等属性
|
|
37
|
+
5. 保存并预览
|
|
38
|
+
|
|
39
|
+
### 2. 代码中使用
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import EntityForm from './components/entity-form';
|
|
43
|
+
|
|
44
|
+
// 基础使用
|
|
45
|
+
<EntityForm
|
|
46
|
+
formTitle="新增联系人"
|
|
47
|
+
xObjectDataApi={{
|
|
48
|
+
xObjectApiKey: 'customContact__c',
|
|
49
|
+
fields: ['name', 'phone__c', 'email__c'],
|
|
50
|
+
}}
|
|
51
|
+
columnCount={2}
|
|
52
|
+
showResetButton={true}
|
|
53
|
+
onSuccess={(data) => {
|
|
54
|
+
console.log('提交成功:', data);
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 支持的字段类型
|
|
60
|
+
|
|
61
|
+
组件支持以下字段类型,并自动渲染对应的输入组件:
|
|
62
|
+
|
|
63
|
+
| 字段类型 | 输入组件 | 说明 |
|
|
64
|
+
|---------|---------|------|
|
|
65
|
+
| text | Input | 单行文本输入框 |
|
|
66
|
+
| textarea | TextArea | 多行文本输入框 |
|
|
67
|
+
| int / float | InputNumber | 数字输入框 |
|
|
68
|
+
| email | Input (email) | 邮箱输入框 |
|
|
69
|
+
| phone | Input (tel) | 电话号码输入框 |
|
|
70
|
+
| url | Input (url) | URL 输入框 |
|
|
71
|
+
| date | DatePicker | 日期选择器 |
|
|
72
|
+
| datetime | DatePicker | 日期时间选择器 |
|
|
73
|
+
| time | DatePicker | 时间选择器 |
|
|
74
|
+
| picklist | Select | 单选下拉框 |
|
|
75
|
+
| multipicklist | Select (multiple) | 多选下拉框 |
|
|
76
|
+
| entityType | Select | 业务类型选择器 |
|
|
77
|
+
|
|
78
|
+
## 技术实现
|
|
79
|
+
|
|
80
|
+
### 核心依赖
|
|
81
|
+
|
|
82
|
+
- **Ant Design**:UI 组件库
|
|
83
|
+
- **React**:前端框架
|
|
84
|
+
- **TypeScript**:类型支持
|
|
85
|
+
- **Neo Open API**:数据操作 SDK
|
|
86
|
+
|
|
87
|
+
### 数据流程
|
|
88
|
+
|
|
89
|
+
1. **初始化**:组件挂载时获取字段描述和业务类型列表
|
|
90
|
+
2. **表单生成**:根据字段描述动态生成表单项
|
|
91
|
+
3. **数据验证**:提交前进行必填字段验证
|
|
92
|
+
4. **数据提交**:使用 `xObject.create` 创建新记录
|
|
93
|
+
5. **结果反馈**:显示成功或失败提示
|
|
94
|
+
|
|
95
|
+
### 表单布局
|
|
96
|
+
|
|
97
|
+
组件支持两种布局模式:
|
|
98
|
+
|
|
99
|
+
- **单列布局**:适合字段较多或需要宽输入框的场景
|
|
100
|
+
- **双列布局**:适合字段较少或需要紧凑布局的场景
|
|
101
|
+
|
|
102
|
+
## 样式定制
|
|
103
|
+
|
|
104
|
+
组件提供了完整的 SCSS 样式文件,支持以下定制:
|
|
105
|
+
|
|
106
|
+
- 表单样式(标签、输入框、间距等)
|
|
107
|
+
- 按钮样式(颜色、大小、位置等)
|
|
108
|
+
- 成功提示样式(动画、颜色等)
|
|
109
|
+
- 响应式设计(移动端适配)
|
|
110
|
+
|
|
111
|
+
## 注意事项
|
|
112
|
+
|
|
113
|
+
1. **权限要求**:确保用户有对应 XObject 的写入权限
|
|
114
|
+
2. **必填字段**:表单会根据字段的 required 属性进行验证
|
|
115
|
+
3. **日期格式**:日期类型字段会自动转换为时间戳格式提交
|
|
116
|
+
4. **错误处理**:组件内置了完善的错误处理和用户提示
|
|
117
|
+
5. **字段过滤**:如果指定了 fields 参数,只会显示指定的字段
|
|
118
|
+
|
|
119
|
+
## 扩展开发
|
|
120
|
+
|
|
121
|
+
如需扩展功能,可以:
|
|
122
|
+
|
|
123
|
+
1. **添加字段类型支持**:在 `renderForm()` 方法中添加新的字段类型
|
|
124
|
+
2. **自定义验证规则**:在表单项的 rules 中添加自定义验证
|
|
125
|
+
3. **添加提交前处理**:在 `handleSubmit()` 方法中添加数据预处理逻辑
|
|
126
|
+
4. **自定义样式**:修改 `style.scss` 文件定制组件外观
|
|
127
|
+
5. **添加回调事件**:扩展组件 props 支持更多回调事件
|
|
128
|
+
|
|
129
|
+
## 示例场景
|
|
130
|
+
|
|
131
|
+
### 场景一:客户信息录入
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
<EntityForm
|
|
135
|
+
formTitle="新增客户"
|
|
136
|
+
xObjectDataApi={{
|
|
137
|
+
xObjectApiKey: 'account',
|
|
138
|
+
fields: ['name', 'industry', 'phone', 'email', 'website'],
|
|
139
|
+
}}
|
|
140
|
+
columnCount={2}
|
|
141
|
+
onSuccess={(data) => {
|
|
142
|
+
message.success('客户创建成功');
|
|
143
|
+
// 跳转到客户详情页
|
|
144
|
+
}}
|
|
145
|
+
/>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 场景二:联系人快速录入
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
<EntityForm
|
|
152
|
+
formTitle="新增联系人"
|
|
153
|
+
xObjectDataApi={{
|
|
154
|
+
xObjectApiKey: 'customContact__c',
|
|
155
|
+
fields: ['name', 'phone__c', 'email__c'],
|
|
156
|
+
}}
|
|
157
|
+
columnCount={1}
|
|
158
|
+
showResetButton={true}
|
|
159
|
+
/>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### 场景三:自定义对象数据录入
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
<EntityForm
|
|
166
|
+
formTitle="新增订单"
|
|
167
|
+
xObjectDataApi={{
|
|
168
|
+
xObjectApiKey: 'customOrder__c',
|
|
169
|
+
}}
|
|
170
|
+
columnCount={2}
|
|
171
|
+
onSuccess={(data) => {
|
|
172
|
+
console.log('订单创建成功:', data);
|
|
173
|
+
}}
|
|
174
|
+
/>
|
|
175
|
+
```
|
|
176
|
+
|