neo-cmp-cli 1.13.17 → 1.13.19

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.
Files changed (91) hide show
  1. package/README.md +23 -3
  2. package/dist/index2.js +1 -1
  3. package/dist/neo/env.js +1 -1
  4. package/dist/neo/pushCmp.js +1 -1
  5. package/dist/package.json.js +1 -1
  6. package/package.json +3 -2
  7. package/template/asset-manage-template/docs/README.md +1 -232
  8. package/template/echarts-custom-cmp-template/package.json +1 -1
  9. package/template/neo-bi-cmps/package.json +1 -1
  10. package/template/neo-bi-cmps/src/components/filterBar__c/common.scss +1 -1
  11. package/template/neo-bi-cmps/src/components/filterBar__c/index.tsx +18 -10
  12. package/template/neo-bi-cmps/src/components/filterBar__c/model.ts +8 -2
  13. package/template/neo-bi-cmps/src/components/targetNumber__c/model.ts +1 -1
  14. package/template/neo-bi-cmps/src/utils/common.ts +18 -20
  15. package/template/neo-bi-cmps/src/utils/filter2chartFilter.ts +4 -6
  16. package/template/neo-bi-cmps/src/utils/pipelineFunnel.ts +4 -2
  17. package/template/neo-bi-cmps/src/utils/simpleTable.tsx +21 -16
  18. package/template/neo-custom-cmp-template/docs/README.md +0 -231
  19. package/template/neo-custom-cmp-template/package.json +1 -1
  20. package/template/neo-h5-cmps/src/components/entityList__c/index.tsx +1 -2
  21. package/template/neo-h5-cmps/src/components/entityTabs__c/index.tsx +1 -1
  22. package/template/neo-h5-cmps/src/components/globalSearchInput__c/index.tsx +1 -1
  23. package/template/neo-h5-cmps/src/components/openChatPageBtn__c/index.tsx +1 -2
  24. package/template/neo-pipeline-cmps/neo.config.js +11 -0
  25. package/template/neo-pipeline-cmps/src/assets/css/common.scss +16 -16
  26. package/template/neo-pipeline-cmps/src/assets/css/mixin.scss +5 -5
  27. package/template/neo-pipeline-cmps/src/components/filterBar__c/README.md +9 -9
  28. package/template/neo-pipeline-cmps/src/components/filterBar__c/common.scss +5 -5
  29. package/template/neo-pipeline-cmps/src/components/filterBar__c/index.tsx +47 -46
  30. package/template/neo-pipeline-cmps/src/components/filterBar__c/model.ts +22 -12
  31. package/template/neo-pipeline-cmps/src/components/filterBar__c/style.scss +1 -1
  32. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/README.md +17 -17
  33. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/index.tsx +24 -22
  34. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/model.ts +31 -18
  35. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/reset.scss +4 -0
  36. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/index.tsx +33 -26
  37. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/model.ts +9 -9
  38. package/template/neo-pipeline-cmps/src/components/simpleTable__c/README.md +53 -54
  39. package/template/neo-pipeline-cmps/src/components/simpleTable__c/common.scss +5 -5
  40. package/template/neo-pipeline-cmps/src/components/simpleTable__c/index.tsx +70 -68
  41. package/template/neo-pipeline-cmps/src/components/simpleTable__c/model.ts +41 -41
  42. package/template/neo-pipeline-cmps/src/components/simpleTable__c/style.scss +2 -3
  43. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/README.md +15 -15
  44. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/index.tsx +35 -33
  45. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/model.ts +29 -16
  46. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/README.md +18 -18
  47. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/index.tsx +20 -20
  48. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/model.ts +34 -19
  49. package/template/neo-pipeline-cmps/src/utils/common.ts +14 -14
  50. package/template/neo-pipeline-cmps/src/utils/filter2chartFilter.ts +21 -23
  51. package/template/neo-pipeline-cmps/src/utils/filterBar.ts +14 -14
  52. package/template/neo-pipeline-cmps/src/utils/pipelineFunnel.ts +5 -5
  53. package/template/neo-pipeline-cmps/src/utils/queryByCustomSQL.ts +26 -22
  54. package/template/neo-pipeline-cmps/src/utils/requestDebounce.ts +3 -3
  55. package/template/neo-pipeline-cmps/src/utils/simpleTable.tsx +31 -26
  56. package/template/neo-pipeline-cmps/src/utils/stageSwitch.ts +1 -1
  57. package/template/neo-pipeline-cmps/src/utils/stageTimeChart.ts +5 -5
  58. package/template/neo-pipeline-cmps/src/utils/targetNumber.ts +2 -2
  59. package/template/neo-web-entity-grid/src/components/createForm__c/index.tsx +271 -259
  60. package/template/neo-web-entity-grid/src/components/createForm__c/model.ts +17 -3
  61. package/template/neo-web-entity-grid/src/components/createForm__c/resetAntd.scss +0 -1
  62. package/template/neo-web-entity-grid/src/components/createForm__c/style.scss +1 -1
  63. package/template/neo-web-entity-grid/src/components/entityGrid2__c/index.tsx +5 -1
  64. package/template/neo-web-entity-grid/src/components/entityGrid2__c/model.ts +4 -3
  65. package/template/neo-web-entity-grid/src/components/entityGrid3__c/index.tsx +1 -1
  66. package/template/neo-web-entity-grid/src/components/searchForm__c/index.tsx +4 -3
  67. package/template/neo-web-entity-grid/src/components/searchForm__c/model.ts +9 -4
  68. package/template/neo-web-entity-grid/src/components/searchForm__c/style.scss +2 -1
  69. package/template/neo-web-form/package.json +1 -1
  70. package/template/neo-web-form/src/components/batchAddTable__c/index.tsx +179 -59
  71. package/template/neo-web-form/src/components/batchAddTable__c/model.ts +12 -14
  72. package/template/neo-web-form/src/components/listSummary__c/index.tsx +6 -5
  73. package/template/react-custom-cmp-template/package.json +1 -1
  74. package/template/asset-manage-template/src/utils/axiosFetcher.ts +0 -37
  75. package/template/asset-manage-template/src/utils/queryObjectData.ts +0 -112
  76. package/template/asset-manage-template/src/utils/xobjects.ts +0 -162
  77. package/template/neo-custom-cmp-template/src/utils/axiosFetcher.ts +0 -37
  78. package/template/neo-custom-cmp-template/src/utils/queryObjectData.ts +0 -112
  79. package/template/neo-custom-cmp-template/src/utils/xobjects.ts +0 -162
  80. package/template/neo-h5-cmps/src/utils/axiosFetcher.ts +0 -37
  81. package/template/neo-h5-cmps/src/utils/queryObjectData.ts +0 -112
  82. package/template/neo-h5-cmps/src/utils/xobjects.ts +0 -167
  83. package/template/neo-order-cmps/src/utils/axiosFetcher.ts +0 -37
  84. package/template/neo-order-cmps/src/utils/queryObjectData.ts +0 -112
  85. package/template/neo-order-cmps/src/utils/xobjects.ts +0 -162
  86. package/template/neo-web-entity-grid/src/utils/axiosFetcher.ts +0 -37
  87. package/template/neo-web-entity-grid/src/utils/queryObjectData.ts +0 -112
  88. package/template/neo-web-entity-grid/src/utils/xobjects.ts +0 -167
  89. package/template/neo-web-form/src/utils/axiosFetcher.ts +0 -37
  90. package/template/neo-web-form/src/utils/queryObjectData.ts +0 -112
  91. package/template/neo-web-form/src/utils/xobjects.ts +0 -167
@@ -248,11 +248,9 @@ function entityTypeChunk(
248
248
  */
249
249
  export const filter2chartFilter = (filter: any): ChartFilterPayload => {
250
250
  const f = filter && typeof filter === 'object' ? filter : {};
251
- const parts = [
252
- closeDateChunk(f),
253
- ownerChunk(f),
254
- entityTypeChunk(f),
255
- ].filter(Boolean) as Omit<ChartFilterItem, 'seq'>[];
251
+ const parts = [closeDateChunk(f), ownerChunk(f), entityTypeChunk(f)].filter(
252
+ Boolean,
253
+ ) as Omit<ChartFilterItem, 'seq'>[];
256
254
 
257
255
  const filterOut: ChartFilterItem[] = parts.map((p, i) => ({
258
256
  ...p,
@@ -265,4 +263,4 @@ export const filter2chartFilter = (filter: any): ChartFilterPayload => {
265
263
  : filterOut.map((x) => String(x.seq)).join(' and ');
266
264
 
267
265
  return { relation, filter: filterOut };
268
- };
266
+ };
@@ -132,13 +132,15 @@ export function classicFunnelLayerHeightPercents(
132
132
  if (n === 0) return [];
133
133
  const h = Math.max(viewHeightPx, 1);
134
134
  const factor = (h - gapPx * Math.max(n - 1, 0)) / h;
135
- const positives = amountNums.map((v) => (Number.isFinite(v) && v > 0 ? v : 0));
135
+ const positives = amountNums.map((v) =>
136
+ Number.isFinite(v) && v > 0 ? v : 0,
137
+ );
136
138
  const sum = positives.reduce((a, v) => a + v, 0);
137
139
  if (sum <= 0) {
138
140
  const even = (100 / n) * factor;
139
141
  return Array(n).fill(`${even}%`);
140
142
  }
141
- return positives.map((v) => `${(100 * (v / sum)) * factor}%`);
143
+ return positives.map((v) => `${100 * (v / sum) * factor}%`);
142
144
  }
143
145
 
144
146
  export interface BuildFunnelChartOptionParams {
@@ -91,9 +91,7 @@ export function historyRowToSnap(row: unknown): HistoryOppSnap | null {
91
91
  opportunityName: String(
92
92
  o.opportunity_1_opportunityName ?? o.opportunityName ?? '',
93
93
  ),
94
- saleStageId: String(
95
- o.opportunity_1_saleStageId ?? o.saleStageId ?? '',
96
- ),
94
+ saleStageId: String(o.opportunity_1_saleStageId ?? o.saleStageId ?? ''),
97
95
  money: o.opportunity_1_money ?? o.money,
98
96
  };
99
97
  }
@@ -151,7 +149,9 @@ export function formatMoneyCell(value: unknown): string {
151
149
  }
152
150
 
153
151
  /** oppHealthAssessmentLevel:数值 → 健康度标签(带颜色背景) */
154
- export function renderOppHealthAssessmentLevel(value: unknown): React.ReactNode {
152
+ export function renderOppHealthAssessmentLevel(
153
+ value: unknown,
154
+ ): React.ReactNode {
155
155
  if (value == null || value === '') return '—';
156
156
  const n = toFiniteNumber(value);
157
157
  if (n === 5) {
@@ -160,7 +160,9 @@ export function renderOppHealthAssessmentLevel(value: unknown): React.ReactNode
160
160
  );
161
161
  }
162
162
  if (n === 6) {
163
- return <span className="opp-health-tag opp-health-tag--yellow">Health</span>;
163
+ return (
164
+ <span className="opp-health-tag opp-health-tag--yellow">Health</span>
165
+ );
164
166
  }
165
167
  if (n === 7) {
166
168
  return <span className="opp-health-tag opp-health-tag--red">Risk</span>;
@@ -205,7 +207,9 @@ export function moneyChangeTooltipTitle(
205
207
  <div className="simpleTable-change-tip__detail">
206
208
  {formatMoneyCell(h.money)}
207
209
  {' → '}
208
- <span className="simpleTable-change-tip__to">{formatMoneyCell(current)}</span>
210
+ <span className="simpleTable-change-tip__to">
211
+ {formatMoneyCell(current)}
212
+ </span>
209
213
  </div>
210
214
  <div className="simpleTable-change-tip__meta">
211
215
  Changed on {formatChangeRecordedAt(preset)}
@@ -227,7 +231,9 @@ export function closeDateChangeTooltipTitle(
227
231
  <div className="simpleTable-change-tip__detail">
228
232
  {formatCloseDate(h.closeDate)}
229
233
  {' → '}
230
- <span className="simpleTable-change-tip__to">{formatCloseDate(current)}</span>
234
+ <span className="simpleTable-change-tip__to">
235
+ {formatCloseDate(current)}
236
+ </span>
231
237
  </div>
232
238
  <div className="simpleTable-change-tip__meta">
233
239
  Changed on {formatChangeRecordedAt(preset)}
@@ -275,15 +281,10 @@ export function renderWinRateHoverCard(record: any): React.ReactNode {
275
281
  const negatives = record?.customItem242__c;
276
282
  const winRate = record?.customItem239__c;
277
283
 
278
- const fmtLine = (v: unknown) =>
279
- v == null || v === '' ? '—' : String(v);
284
+ const fmtLine = (v: unknown) => (v == null || v === '' ? '—' : String(v));
280
285
 
281
286
  return (
282
- <Card
283
- size="small"
284
- bordered={false}
285
- className="simpleTable-winrate-card"
286
- >
287
+ <Card size="small" bordered={false} className="simpleTable-winrate-card">
287
288
  <div className="simpleTable-winrate-card__baseline">
288
289
  Baseline Probability{' '}
289
290
  <span className="simpleTable-winrate-card__baseline-val">
@@ -291,12 +292,16 @@ export function renderWinRateHoverCard(record: any): React.ReactNode {
291
292
  </span>
292
293
  </div>
293
294
  <hr className="simpleTable-winrate-card__hr" />
294
- <div className="simpleTable-winrate-card__section-title">Positive Factors</div>
295
+ <div className="simpleTable-winrate-card__section-title">
296
+ Positive Factors
297
+ </div>
295
298
  <div className="simpleTable-winrate-card__positives">
296
299
  {fmtLine(positives)}
297
300
  </div>
298
301
  <hr className="simpleTable-winrate-card__hr" />
299
- <div className="simpleTable-winrate-card__section-title">Negative Factors</div>
302
+ <div className="simpleTable-winrate-card__section-title">
303
+ Negative Factors
304
+ </div>
300
305
  <div className="simpleTable-winrate-card__negatives">
301
306
  {fmtLine(negatives)}
302
307
  </div>
@@ -11,234 +11,3 @@
11
11
  - [查询接口(通用查询接口)](https://doc.xiaoshouyi.com/#/proMan/workplaceDetailApi?url=%2F%2Fconcepts%2Fapi_queryInterfaceDescription.html&id=1405&dir=output_1757929564205&time=1758784491846): /rest/data/v2/query;
12
12
  - [获取业务类型描述](https://doc.xiaoshouyi.com/?sso-domain=login-cd.xiaoshouyi.com#/proMan/workplaceDetailApi?url=%2F%2Fconcepts%2Fapi_paas_customObject_getBusinessTypeDescription.html&id=1405&dir=output_1757929564205&time=1758798530511): /rest/data/v2.0/xobjects/{xObjectApiKey}/busiType;
13
13
  - 更多可用接口见[文档](https://doc.xiaoshouyi.com/#/proMan/workplaceDetailApi?url=%2F%2Fconcepts%2Fapi_apiIntroduction.html&id=1405&dir=output_1757929564205)。
14
-
15
- ## Open API 请求方法
16
-
17
- ### 基础请求工具
18
-
19
- #### axiosFetcher
20
- 基于 axios 封装的通用请求工具,支持 GET、POST、PATCH、DELETE 等请求方法。
21
-
22
- ```typescript
23
- import axiosFetcher from '@/utils/axiosFetcher';
24
-
25
- // 基本用法
26
- const result = await axiosFetcher({
27
- url: '/api/endpoint',
28
- method: 'GET',
29
- data: { key: 'value' },
30
- headers: { 'Custom-Header': 'value' },
31
- timeout: 30000
32
- });
33
- ```
34
-
35
- **参数说明:**
36
- - `url`: 请求地址
37
- - `method`: 请求方法,默认为 'GET'
38
- - `data`: 请求数据,GET 请求会转为 params
39
- - `headers`: 请求头,默认包含 'Content-Type': 'application/json'
40
- - `timeout`: 超时时间,默认 30000ms
41
-
42
- ### 业务对象相关接口
43
-
44
- #### 1. 查询业务对象数据列表 (queryXObjectData)
45
- 使用通用查询接口获取业务对象数据,支持分页和排序。
46
-
47
- ```typescript
48
- import { queryXObjectData } from '@/utils/queryObjectData';
49
-
50
- // 基本查询
51
- const result = await queryXObjectData({
52
- xObjectApiKey: 'Contact', // 业务对象 API Key
53
- fields: ['name', 'phone', 'email'], // 查询字段
54
- page: 1, // 页码
55
- pageSize: 10, // 每页数量
56
- orderBy: 'name asc' // 排序条件(可选)
57
- });
58
- ```
59
-
60
- **参数说明:**
61
- - `xObjectApiKey`: 业务对象的 API Key
62
- - `fields`: 需要查询的字段数组,会自动添加 'id' 字段
63
- - `page`: 页码,默认为 1
64
- - `pageSize`: 每页数量,默认为 10
65
- - `orderBy`: 排序条件,如 'name asc' 或 'createdTime desc'
66
-
67
- **返回结果:**
68
- ```typescript
69
- {
70
- code: 200,
71
- result: {
72
- // 查询结果数据
73
- records: any[],
74
- // 分页信息
75
- totalSize: number, // 总个数
76
- }
77
- }
78
- ```
79
-
80
- #### 2. 获取业务类型列表 (getEntityTypeList)
81
- 获取指定业务对象的业务类型列表。
82
-
83
- ```typescript
84
- import { getEntityTypeList } from '@/utils/xobjects';
85
-
86
- const result = await getEntityTypeList('Contact', {
87
- // 其他请求选项
88
- });
89
- ```
90
-
91
- **参数说明:**
92
- - `xObjectApiKey`: 业务对象的 API Key
93
- - `options`: 可选的请求配置
94
-
95
- #### 3. 获取对象列表 (getEntityList)
96
- 获取系统中的对象列表,支持标准对象和自定义对象。
97
-
98
- ```typescript
99
- import { getEntityList } from '@/utils/xobjects';
100
-
101
- // 获取标准对象列表
102
- const standardObjects = await getEntityList({
103
- custom: false, // 获取标准对象
104
- active: true // 仅获取有权限的对象
105
- });
106
-
107
- // 获取自定义对象列表
108
- const customObjects = await getEntityList({
109
- custom: true, // 获取自定义对象
110
- active: true // 仅获取有权限的对象
111
- });
112
- ```
113
-
114
- **参数说明:**
115
- - `custom`: 是否获取自定义对象,false 为标准对象,true 为自定义对象
116
- - `active`: 是否仅获取有权限的对象,默认为 true
117
-
118
- #### 4. 创建业务数据 (createXObject)
119
- 创建新的业务数据记录。
120
-
121
- ```typescript
122
- import { createXObject } from '@/utils/xobjects';
123
-
124
- const result = await createXObject('Contact', {
125
- method: 'POST',
126
- data: {
127
- name: '张三',
128
- phone: '13800138000',
129
- email: 'zhangsan@example.com'
130
- }
131
- });
132
- ```
133
-
134
- **参数说明:**
135
- - `xObjectApiKey`: 业务对象的 API Key
136
- - `options.data`: 要创建的数据对象
137
- - `options.method`: 请求方法,默认为 'GET'(建议使用 'POST')
138
-
139
- #### 5. 更新业务数据 (updateXObject)
140
- 更新指定的业务数据记录。
141
-
142
- ```typescript
143
- import { updateXObject } from '@/utils/xobjects';
144
-
145
- const result = await updateXObject('Contact', '12345', {
146
- method: 'PATCH',
147
- data: {
148
- name: '李四',
149
- phone: '13900139000'
150
- }
151
- });
152
- ```
153
-
154
- **参数说明:**
155
- - `xObjectApiKey`: 业务对象的 API Key
156
- - `objectId`: 要更新的记录 ID
157
- - `options.data`: 要更新的数据对象
158
- - `options.method`: 请求方法,默认为 'PATCH'
159
-
160
- #### 6. 获取业务数据信息 (getXObject)
161
- 获取指定业务数据记录的详细信息。
162
-
163
- ```typescript
164
- import { getXObject } from '@/utils/xobjects';
165
-
166
- const result = await getXObject('Contact', '12345', {
167
- // 其他请求选项
168
- });
169
- ```
170
-
171
- **参数说明:**
172
- - `xObjectApiKey`: 业务对象的 API Key
173
- - `objectId`: 要获取的记录 ID
174
- - `options`: 可选的请求配置
175
-
176
- #### 7. 删除业务数据 (deleteXObject)
177
- 删除指定的业务数据记录。
178
-
179
- ```typescript
180
- import { deleteXObject } from '@/utils/xobjects';
181
-
182
- const result = await deleteXObject('Contact', '12345');
183
- ```
184
-
185
- **参数说明:**
186
- - `xObjectApiKey`: 业务对象的 API Key
187
- - `objectId`: 要删除的记录 ID
188
-
189
- #### 8. 获取业务对象描述 (getXObjectDesc)
190
- 获取业务对象的描述信息。
191
-
192
- ```typescript
193
- import { getXObjectDesc } from '@/utils/xobjects';
194
-
195
- const result = await getXObjectDesc('Contact');
196
- ```
197
-
198
- **参数说明:**
199
- - `xObjectApiKey`: 业务对象的 API Key
200
-
201
- ### 使用示例
202
-
203
- ```typescript
204
- import {
205
- queryXObjectData,
206
- createXObject,
207
- updateXObject,
208
- getXObject,
209
- deleteXObject
210
- } from '@/utils/xobjects';
211
-
212
- // 查询联系人列表
213
- const contacts = await queryXObjectData({
214
- xObjectApiKey: 'Contact',
215
- fields: ['name', 'phone', 'email'],
216
- page: 1,
217
- pageSize: 20,
218
- orderBy: 'createdTime desc'
219
- });
220
-
221
- // 创建新联系人
222
- const newContact = await createXObject('Contact', {
223
- method: 'POST',
224
- data: {
225
- name: '王五',
226
- phone: '13700137000',
227
- email: 'wangwu@example.com'
228
- }
229
- });
230
-
231
- // 更新联系人
232
- const updatedContact = await updateXObject('Contact', newContact.id, {
233
- data: {
234
- name: '王五(更新)'
235
- }
236
- });
237
-
238
- // 获取联系人详情
239
- const contactDetail = await getXObject('Contact', newContact.id);
240
-
241
- // 删除联系人
242
- await deleteXObject('Contact', newContact.id);
243
- ```
244
-
@@ -55,7 +55,7 @@
55
55
  "@types/react": "^16.9.11",
56
56
  "@types/react-dom": "^16.9.15",
57
57
  "@types/axios": "^0.14.0",
58
- "neo-cmp-cli": "^1.13.17",
58
+ "neo-cmp-cli": "^1.13.18",
59
59
  "husky": "^4.2.5",
60
60
  "lint-staged": "^10.2.9",
61
61
  "prettier": "^2.0.5"
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
- import './style.scss'; // 组件内容样式
3
2
  // @ts-ignore
4
3
  import { NeoEntityList } from 'neo-ui-component-h5'; // neo h5 组件库
5
-
4
+ import './style.scss'; // 组件内容样式
6
5
  interface EntityListProps {
7
6
  entityApiKey: string;
8
7
  disableSearch?: boolean;
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { Tabs } from 'antd-mobile';
3
- import './style.scss'; // 组件内容样式
4
3
  // @ts-ignore
5
4
  import { NeoEntityList } from 'neo-ui-component-h5'; // neo h5 组件库
5
+ import './style.scss'; // 组件内容样式
6
6
 
7
7
  interface EntityListTabsProps {
8
8
  entityApiKey?: string;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- import './style.scss'; // 组件内容样式
3
2
  // @ts-ignore
4
3
  import { GlobalSearchInput } from 'neo-ui-component-h5'; // neo h5 组件库
4
+ import './style.scss'; // 组件内容样式
5
5
 
6
6
  interface GlobalSearchInputProps {
7
7
  placeholder?: string;
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
- import { BaseCmp } from 'neo-ui-common';
3
2
  // @ts-ignore
4
- import { NeoEvent } from 'neo-ui-common';
3
+ import { BaseCmp, NeoEvent } from 'neo-ui-common';
5
4
  import './style.scss'; // 组件内容样式
6
5
 
7
6
  interface openChatPageBtnProps {
@@ -51,6 +51,17 @@ module.exports = {
51
51
  // externals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
52
52
  },
53
53
  */
54
+ /*
55
+ // 示例2
56
+ neoCommonModule: {
57
+ // exports: ['xxModule'], // 数组写法,用于导出当前自定义组件中的第三方依赖模块
58
+ exports: { // 对象写法,可用于导出自定义组件中的某个内容模块(需要使用绝对路径导出)
59
+ 'xxModule': path.resolve('./src/components/xxModule'), // 导出 xx组件 或 xx模块
60
+ },
61
+ remoteDeps: ['filterBar__c'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
62
+ externals: ['filterBar__c'], // 自定义组件中需要剔除的模块,仅支持数组写法
63
+ },
64
+ */
54
65
  linkDebug: {
55
66
  // 用于开启本地调试模式的相关配置信息
56
67
  /*
@@ -1,4 +1,4 @@
1
- /* 公共的自定义函数 */
1
+ /* Common custom functions */
2
2
 
3
3
  @function px2vw($px, $screen-width: 750) {
4
4
  @return ($px / $screen-width) * 100vw;
@@ -17,7 +17,7 @@
17
17
  height: 100%;
18
18
  }
19
19
 
20
- /* 头部细线 */
20
+ /* Top hairline border */
21
21
  @mixin borderTop {
22
22
  content: '';
23
23
  position: absolute;
@@ -30,7 +30,7 @@
30
30
  transform: scaleY(0.5);
31
31
  }
32
32
 
33
- /* 底部细线 */
33
+ /* Bottom hairline border */
34
34
  @mixin borderBtm {
35
35
  content: '';
36
36
  position: absolute;
@@ -43,44 +43,44 @@
43
43
  transform: scaleY(0.5);
44
44
  }
45
45
 
46
- /* 统一的内边距 */
46
+ /* Unified padding */
47
47
  @mixin unifiedPadding($value: 40) {
48
48
  padding: 0 px2rem($value) 0 px2rem($value);
49
49
  }
50
50
 
51
- /* 统一的左内边距 */
51
+ /* Unified left padding */
52
52
  @mixin unifiedLeftPadding($value: 40) {
53
53
  padding-left: px2rem($value);
54
54
  }
55
55
 
56
- /* 统一的右内边距 */
56
+ /* Unified right padding */
57
57
  @mixin unifiedRightPadding($value: 40) {
58
58
  padding-right: px2rem($value);
59
59
  }
60
60
 
61
- /* 统一的底部边框样式 */
61
+ /* Unified bottom border style */
62
62
  @mixin unifiedBottomBorder {
63
63
  border-bottom: 1px solid #ddd;
64
64
  }
65
65
 
66
- /* 统一的上边框样式 */
66
+ /* Unified top border style */
67
67
  @mixin unifiedTopBorder {
68
68
  border-top: 1px solid #ddd;
69
69
  }
70
70
 
71
- /* 统一的Item高度 */
71
+ /* Unified item height */
72
72
  @mixin unifiedItemHeight {
73
73
  line-height: px2rem(120);
74
74
  height: px2rem(120);
75
75
  }
76
76
 
77
- /* 设置行高样式 */
77
+ /* Set line-height style */
78
78
  @mixin setItemHeight($value: 120) {
79
79
  line-height: px2rem($value);
80
80
  height: px2rem($value);
81
81
  }
82
82
 
83
- /* 统一的Item样式 */
83
+ /* Unified item style */
84
84
  @mixin unifiedItemStyle {
85
85
  font-family: PingFangSC-Regular;
86
86
  font-size: px2rem(28);
@@ -88,7 +88,7 @@
88
88
  letter-spacing: 0;
89
89
  }
90
90
 
91
- /* 统一的弹性盒子样式 */
91
+ /* Unified flexbox style */
92
92
  @mixin unifiedFlexBoxStyle {
93
93
  display: flex;
94
94
  flex-wrap: nowrap;
@@ -96,14 +96,14 @@
96
96
  align-items: center;
97
97
  }
98
98
 
99
- /* 统一的Title样式 */
99
+ /* Unified title style */
100
100
  @mixin unifiedTitleStyle {
101
101
  font-family: PingFangSC-Regular;
102
102
  font-size: px2rem(40);
103
103
  color: #1e1e1e;
104
104
  }
105
105
 
106
- /* 统一的内容样式 */
106
+ /* Unified content style */
107
107
  @mixin unifiedContentStyle {
108
108
  font-family: PingFangSC-Regular;
109
109
  font-size: px2rem(28);
@@ -113,7 +113,7 @@
113
113
  line-height: px2rem(28);
114
114
  }
115
115
 
116
- /* 底部导航盒子样式 */
116
+ /* Fixed bottom navigation box style */
117
117
  @mixin fixedBottomBox {
118
118
  position: fixed;
119
119
  left: 0;
@@ -121,7 +121,7 @@
121
121
  width: 100%;
122
122
  }
123
123
 
124
- // 常用的变量
124
+ // Common variables
125
125
  $background-color: #fafafa;
126
126
  $border-color: #f7f7f7;
127
127
  $page-padding-top: px2rem(20);
@@ -1,7 +1,7 @@
1
- // 通用mixin
1
+ // Common mixins
2
2
  $borderColor: #ddd;
3
3
 
4
- // type top 或者 bottom
4
+ // type is top or bottom
5
5
  @mixin borderTopOrBtm($type) {
6
6
  &::after {
7
7
  content: '';
@@ -16,7 +16,7 @@ $borderColor: #ddd;
16
16
  }
17
17
  }
18
18
 
19
- // type right 或者 left
19
+ // type is right or left
20
20
  @mixin borderRtOrLt($type) {
21
21
  &::after {
22
22
  content: '';
@@ -31,14 +31,14 @@ $borderColor: #ddd;
31
31
  }
32
32
  }
33
33
 
34
- //超出1行显示...
34
+ //Ellipsis after 1 line
35
35
  @mixin ellipsis1 {
36
36
  overflow: hidden;
37
37
  text-overflow: ellipsis;
38
38
  white-space: nowrap;
39
39
  }
40
40
 
41
- // 超出多行显示...
41
+ // Ellipsis after multiple lines
42
42
  @mixin ellipsis($num) {
43
43
  overflow: hidden;
44
44
  display: -webkit-box;
@@ -1,8 +1,8 @@
1
- # FilterBar 组件
1
+ # FilterBar Component
2
2
 
3
- 筛选栏组件,支持日期范围、用户和部门、业务类型等多维度筛选。
3
+ Filter bar component that supports multi-dimensional filtering by date range, user and department, business type, etc.
4
4
 
5
- ## 使用方式
5
+ ## Usage
6
6
 
7
7
  ```tsx
8
8
  import FilterBar from './components/filterBar__c';
@@ -14,11 +14,11 @@ import FilterBar from './components/filterBar__c';
14
14
 
15
15
  ## Props
16
16
 
17
- | 属性 | 说明 | 类型 | 默认值 |
18
- |------|------|------|--------|
19
- | values | 筛选值 | Record<string, string> | {} |
20
- | onChange | 筛选变化回调 | (key: string, value: string) => void | - |
17
+ | Property | Description | Type | Default |
18
+ |----------|-------------|------|---------|
19
+ | values | Filter values | Record<string, string> | {} |
20
+ | onChange | Filter change callback | (key: string, value: string) => void | - |
21
21
 
22
22
 
23
- ## 说明
24
- 1、获取 相对时间的接口:/rest/neobi/v2.0/config/getOption
23
+ ## Notes
24
+ 1. API for getting relative time options: /rest/neobi/v2.0/config/getOption.
@@ -1,12 +1,12 @@
1
- // css变量
1
+ // CSS variables
2
2
  :root {
3
3
  --background-color: #f5f6fa;
4
4
  }
5
- // sass变量
5
+ // SASS variables
6
6
  $background-color: #f5f6fa;
7
- // 自定义公共样式
7
+ // Custom common styles
8
8
 
9
- // 自定义页面最外层容器背景色
9
+ // Custom page outermost container background color
10
10
  body {
11
11
  // background-color: var(--background-color);
12
12
  background-color: $background-color;
@@ -26,4 +26,4 @@ body {
26
26
 
27
27
  .single-slot-layout .content-section {
28
28
  background-color: $background-color !important;
29
- }
29
+ }