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,260 @@
|
|
|
1
|
+
.entity-card-list-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: 12px;
|
|
9
|
+
background-color: #fff;
|
|
10
|
+
border-radius: 8px;
|
|
11
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
12
|
+
|
|
13
|
+
.card-list-header {
|
|
14
|
+
flex-shrink: 0;
|
|
15
|
+
margin-bottom: 16px;
|
|
16
|
+
border-bottom: 1px solid #f0f0f0;
|
|
17
|
+
padding-bottom: 12px;
|
|
18
|
+
|
|
19
|
+
.header-content {
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 16px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.header-title {
|
|
27
|
+
margin: 0;
|
|
28
|
+
font-family: PingFangSC-Medium, -apple-system, BlinkMacSystemFont,
|
|
29
|
+
'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
30
|
+
font-size: 18px;
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
line-height: 1.4;
|
|
33
|
+
color: #262626;
|
|
34
|
+
flex: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.refresh-button {
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
border-radius: 6px;
|
|
40
|
+
font-size: 13px;
|
|
41
|
+
height: 32px;
|
|
42
|
+
padding: 4px 12px;
|
|
43
|
+
box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
|
|
44
|
+
transition: all 0.3s ease;
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
box-shadow: 0 4px 8px rgba(24, 144, 255, 0.3);
|
|
48
|
+
transform: translateY(-1px);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:active {
|
|
52
|
+
transform: translateY(0);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.anticon {
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.card-list-content {
|
|
62
|
+
flex: 1;
|
|
63
|
+
overflow-y: auto;
|
|
64
|
+
|
|
65
|
+
.error-container {
|
|
66
|
+
display: flex;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
align-items: center;
|
|
69
|
+
min-height: 300px;
|
|
70
|
+
padding: 20px;
|
|
71
|
+
|
|
72
|
+
.retry-button {
|
|
73
|
+
padding: 8px 16px;
|
|
74
|
+
background-color: #1890ff;
|
|
75
|
+
color: white;
|
|
76
|
+
border: none;
|
|
77
|
+
border-radius: 4px;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
transition: background-color 0.3s;
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
background-color: #40a9ff;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:active {
|
|
87
|
+
background-color: #096dd9;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.object-card {
|
|
94
|
+
height: 100%;
|
|
95
|
+
border-radius: 12px;
|
|
96
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
|
97
|
+
transition: all 0.3s ease;
|
|
98
|
+
border: 1px solid #f0f0f0;
|
|
99
|
+
|
|
100
|
+
&:hover {
|
|
101
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
102
|
+
transform: translateY(-2px);
|
|
103
|
+
border-color: #d9d9d9;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.ant-card-body {
|
|
107
|
+
padding: 16px;
|
|
108
|
+
height: 100%;
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.object-card-content {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
width: 100%;
|
|
117
|
+
gap: 12px;
|
|
118
|
+
|
|
119
|
+
.object-avatar {
|
|
120
|
+
flex-shrink: 0;
|
|
121
|
+
|
|
122
|
+
.avatar-icon {
|
|
123
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
124
|
+
border: 2px solid #fff;
|
|
125
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.object-info {
|
|
130
|
+
flex: 1;
|
|
131
|
+
min-width: 0;
|
|
132
|
+
|
|
133
|
+
.object-name,
|
|
134
|
+
.object-phone {
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
margin-bottom: 4px;
|
|
138
|
+
gap: 6px;
|
|
139
|
+
|
|
140
|
+
&:last-child {
|
|
141
|
+
margin-bottom: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.info-icon {
|
|
145
|
+
font-size: 12px;
|
|
146
|
+
color: #8c8c8c;
|
|
147
|
+
flex-shrink: 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.name-text,
|
|
151
|
+
.phone-text {
|
|
152
|
+
font-size: 14px;
|
|
153
|
+
line-height: 1.4;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
text-overflow: ellipsis;
|
|
156
|
+
white-space: nowrap;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.name-text {
|
|
160
|
+
color: #262626;
|
|
161
|
+
font-weight: 500;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.phone-text {
|
|
165
|
+
color: #595959;
|
|
166
|
+
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo,
|
|
167
|
+
Courier, monospace;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.object-name {
|
|
172
|
+
margin-bottom: 8px;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// 响应式设计
|
|
179
|
+
@media (max-width: 768px) {
|
|
180
|
+
margin: 4px 8px;
|
|
181
|
+
padding: 8px;
|
|
182
|
+
|
|
183
|
+
.card-list-header {
|
|
184
|
+
margin-bottom: 12px;
|
|
185
|
+
padding-bottom: 8px;
|
|
186
|
+
|
|
187
|
+
.header-content {
|
|
188
|
+
gap: 12px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.header-title {
|
|
192
|
+
font-size: 16px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.refresh-button {
|
|
196
|
+
height: 28px;
|
|
197
|
+
padding: 2px 8px;
|
|
198
|
+
font-size: 12px;
|
|
199
|
+
|
|
200
|
+
.anticon {
|
|
201
|
+
font-size: 11px;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.object-card {
|
|
207
|
+
.ant-card-body {
|
|
208
|
+
padding: 12px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.object-card-content {
|
|
212
|
+
gap: 8px;
|
|
213
|
+
|
|
214
|
+
.object-avatar {
|
|
215
|
+
.avatar-icon {
|
|
216
|
+
width: 40px !important;
|
|
217
|
+
height: 40px !important;
|
|
218
|
+
line-height: 40px !important;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.object-info {
|
|
223
|
+
.object-name,
|
|
224
|
+
.object-phone {
|
|
225
|
+
.name-text,
|
|
226
|
+
.phone-text {
|
|
227
|
+
font-size: 13px;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@media (max-width: 480px) {
|
|
236
|
+
.object-card {
|
|
237
|
+
.object-card-content {
|
|
238
|
+
flex-direction: column;
|
|
239
|
+
text-align: center;
|
|
240
|
+
gap: 8px;
|
|
241
|
+
|
|
242
|
+
.object-info {
|
|
243
|
+
.object-name,
|
|
244
|
+
.object-phone {
|
|
245
|
+
justify-content: center;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// 全局样式覆盖
|
|
254
|
+
.ant-spin-container {
|
|
255
|
+
min-height: 200px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.ant-empty {
|
|
259
|
+
padding: 40px 20px;
|
|
260
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# 实体数据详情组件
|
|
2
|
+
实体数据详情组件(entity-detail)是一个用于展示实体数据详细信息的自定义组件。它通过 Neo Open API 获取数据,支持多列布局展示,自动识别字段类型并进行格式化显示。
|
|
3
|
+
|
|
4
|
+
## 功能特性
|
|
5
|
+
|
|
6
|
+
- ✅ **数据获取**:基于 Neo Open API 获取实体数据详情
|
|
7
|
+
- ✅ **多列布局**:支持 1-4 列的灵活布局配置
|
|
8
|
+
- ✅ **字段类型识别**:自动识别并格式化不同类型的字段(布尔值、日期、数字、URL、邮箱、电话等)
|
|
9
|
+
- ✅ **可视化配置**:在编辑器中可视化配置实体类型、数据ID、列数等属性
|
|
10
|
+
- ✅ **响应式设计**:支持不同屏幕尺寸的自适应布局
|
|
11
|
+
- ✅ **刷新功能**:支持手动刷新数据
|
|
12
|
+
- ✅ **错误处理**:完善的错误提示和重试机制
|
|
13
|
+
|
|
14
|
+
## 使用场景
|
|
15
|
+
|
|
16
|
+
- 实体记录详情页展示
|
|
17
|
+
- 数据详情弹窗
|
|
18
|
+
- 审批流程中的数据展示
|
|
19
|
+
- 仪表盘中的详细信息卡片
|
|
20
|
+
|
|
21
|
+
## 组件属性配置
|
|
22
|
+
|
|
23
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
24
|
+
|--------|------|--------|------|
|
|
25
|
+
| title | string | '实体数据详情' | 组件标题 |
|
|
26
|
+
| showTitle | boolean | true | 是否显示标题栏和刷新按钮 |
|
|
27
|
+
| xObjectDetailApi | object | { xObjectApiKey: 'account', objectId: '' } | 业务详情数据配置,包含实体对象API Key和数据ID |
|
|
28
|
+
| xObjectDetailApi.xObjectApiKey | string | 'account' | 实体对象的 API Key |
|
|
29
|
+
| xObjectDetailApi.objectId | string | '' | 要展示的数据记录ID,支持变量如 ${recordId} |
|
|
30
|
+
| columnCount | number | 3 | 详情页面的列数布局(1-4列) |
|
|
31
|
+
|
|
32
|
+
## 字段类型支持
|
|
33
|
+
|
|
34
|
+
组件会根据字段类型自动格式化显示:
|
|
35
|
+
|
|
36
|
+
- **boolean**:显示为带图标的标签(是/否)
|
|
37
|
+
- **date/datetime**:格式化为本地日期时间
|
|
38
|
+
- **number/currency/percent**:使用千分位格式化
|
|
39
|
+
- **url**:显示为可点击的链接
|
|
40
|
+
- **email**:显示为邮箱链接
|
|
41
|
+
- **phone**:显示为电话链接
|
|
42
|
+
- **text**:普通文本显示
|
|
43
|
+
- **空值**:显示为 "-"
|
|
44
|
+
|
|
45
|
+
## 使用示例
|
|
46
|
+
|
|
47
|
+
### 基础用法
|
|
48
|
+
|
|
49
|
+
```jsx
|
|
50
|
+
<EntityDetail
|
|
51
|
+
title="客户详情"
|
|
52
|
+
xObjectDetailApi={{
|
|
53
|
+
xObjectApiKey: "account",
|
|
54
|
+
objectId: "12345"
|
|
55
|
+
}}
|
|
56
|
+
columnCount={3}
|
|
57
|
+
/>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 使用变量
|
|
61
|
+
|
|
62
|
+
在 Neo 平台中,可以使用上下文变量:
|
|
63
|
+
|
|
64
|
+
```jsx
|
|
65
|
+
<EntityDetail
|
|
66
|
+
title="当前记录详情"
|
|
67
|
+
xObjectDetailApi={{
|
|
68
|
+
xObjectApiKey: "customContact__c",
|
|
69
|
+
objectId: "${recordId}"
|
|
70
|
+
}}
|
|
71
|
+
columnCount={2}
|
|
72
|
+
/>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 隐藏标题栏
|
|
76
|
+
|
|
77
|
+
```jsx
|
|
78
|
+
<EntityDetail
|
|
79
|
+
showTitle={false}
|
|
80
|
+
xObjectDetailApi={{
|
|
81
|
+
xObjectApiKey: "account",
|
|
82
|
+
objectId: "12345"
|
|
83
|
+
}}
|
|
84
|
+
columnCount={1}
|
|
85
|
+
/>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 技术实现
|
|
89
|
+
|
|
90
|
+
### 数据获取
|
|
91
|
+
|
|
92
|
+
组件使用以下 API 获取数据:
|
|
93
|
+
|
|
94
|
+
1. **xObject.get**:获取单条实体数据
|
|
95
|
+
2. **xObject.getDesc**:获取实体字段描述信息
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// 获取详情数据
|
|
99
|
+
const result = await xObject.get(xObjectDetailApi.xObjectApiKey, xObjectDetailApi.objectId);
|
|
100
|
+
|
|
101
|
+
// 获取字段描述
|
|
102
|
+
const descResult = await xObject.getDesc(xObjectDetailApi.xObjectApiKey);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 布局方案
|
|
106
|
+
|
|
107
|
+
组件采用 Ant Design 的 Row/Col 栅格系统,根据 `columnCount` 属性动态分配字段到不同的列中:
|
|
108
|
+
|
|
109
|
+
- 1列:每列占 24 格(100%宽度)
|
|
110
|
+
- 2列:每列占 12 格(50%宽度)
|
|
111
|
+
- 3列:每列占 8 格(33.3%宽度)
|
|
112
|
+
- 4列:每列占 6 格(25%宽度)
|
|
113
|
+
|
|
114
|
+
### 响应式适配
|
|
115
|
+
|
|
116
|
+
- **桌面端**(>1200px):按配置的列数显示
|
|
117
|
+
- **平板端**(768px-1200px):3列及以上自动调整为2列
|
|
118
|
+
- **移动端**(<768px):自动调整为单列显示
|
|
119
|
+
|
|
120
|
+
## 样式定制
|
|
121
|
+
|
|
122
|
+
组件提供了丰富的 CSS 类名,可以通过自定义样式进行个性化定制:
|
|
123
|
+
|
|
124
|
+
```scss
|
|
125
|
+
.entity-detail-container {
|
|
126
|
+
// 容器样式
|
|
127
|
+
|
|
128
|
+
.detail-header {
|
|
129
|
+
// 头部样式
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.detail-content {
|
|
133
|
+
// 内容区域样式
|
|
134
|
+
|
|
135
|
+
.detail-column-card {
|
|
136
|
+
// 列卡片样式
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## 注意事项
|
|
143
|
+
|
|
144
|
+
1. **xObjectDetailApi 参数必填**:必须提供有效的 `xObjectDetailApi` 对象,包含 `xObjectApiKey` 和 `objectId` 才能正常展示
|
|
145
|
+
2. **权限要求**:确保当前用户有权限访问指定的实体对象
|
|
146
|
+
3. **字段过滤**:组件会自动过滤以下划线开头的系统字段
|
|
147
|
+
4. **性能优化**:大量字段时建议使用2-3列布局以保证用户体验
|
|
148
|
+
5. **属性结构**:使用 `xObjectDetailApi` 对象结构,提供更清晰的数据配置方式
|
|
149
|
+
|
|
150
|
+
## 开发说明
|
|
151
|
+
|
|
152
|
+
### 目录结构
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
entity-detail/
|
|
156
|
+
├── index.tsx # 组件主文件
|
|
157
|
+
├── model.ts # 编辑器配置文件
|
|
158
|
+
├── style.scss # 样式文件
|
|
159
|
+
└── README.md # 组件文档
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### 依赖包
|
|
163
|
+
|
|
164
|
+
- react: ^16.9.0
|
|
165
|
+
- antd: ^4.9.4
|
|
166
|
+
- neo-open-api: ^1.0.2
|
|
167
|
+
|
|
168
|
+
### 本地开发
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# 预览组件
|
|
172
|
+
npm run preview --cmpType=entity-detail
|
|
173
|
+
|
|
174
|
+
# 构建组件
|
|
175
|
+
npm run build
|
|
176
|
+
```
|