neo-cmp-cli 1.12.7 → 1.12.9

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 (144) hide show
  1. package/README.md +204 -6
  2. package/dist/index2.js +1 -1
  3. package/dist/neo/env.js +1 -1
  4. package/dist/package.json.js +1 -1
  5. package/package.json +1 -1
  6. package/template/antd-custom-cmp-template/package.json +1 -1
  7. package/template/{neo-bi-cmps → asset-manage-template}/README.md +65 -10
  8. package/template/asset-manage-template/docs/README.md +244 -0
  9. package/template/asset-manage-template/neo.config.js +60 -0
  10. package/template/{neo-bi-cmps → asset-manage-template}/package.json +28 -16
  11. package/template/asset-manage-template/src/assets/img/chart.svg +1 -0
  12. package/template/asset-manage-template/src/components/README.md +3 -0
  13. package/template/asset-manage-template/src/components/assetManage__c/assetApi.ts +70 -0
  14. package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetCreateModal.tsx +260 -0
  15. package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetGrid.tsx +48 -0
  16. package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetSidebar.tsx +74 -0
  17. package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetToolbar.tsx +79 -0
  18. package/template/asset-manage-template/src/components/assetManage__c/cmps/assetDisplay.tsx +72 -0
  19. package/template/asset-manage-template/src/components/assetManage__c/constants.ts +28 -0
  20. package/template/asset-manage-template/src/components/assetManage__c/index.tsx +258 -0
  21. package/template/asset-manage-template/src/components/assetManage__c/model.ts +75 -0
  22. package/template/asset-manage-template/src/components/assetManage__c/style.scss +425 -0
  23. package/template/asset-manage-template/src/components/assetManage__c/types.ts +60 -0
  24. package/template/asset-manage-template/src/components/bidList__c/cmps/BidCard.tsx +47 -0
  25. package/template/asset-manage-template/src/components/bidList__c/constants.ts +6 -0
  26. package/template/asset-manage-template/src/components/bidList__c/formatUtils.ts +14 -0
  27. package/template/asset-manage-template/src/components/bidList__c/index.tsx +194 -0
  28. package/template/asset-manage-template/src/components/bidList__c/model.ts +57 -0
  29. package/template/asset-manage-template/src/components/bidList__c/style.scss +179 -0
  30. package/template/asset-manage-template/src/components/bidList__c/types.ts +10 -0
  31. package/template/asset-manage-template/src/components/bidPackage__c/cmps/BidPackageHeader.tsx +140 -0
  32. package/template/asset-manage-template/src/components/bidPackage__c/cmps/PackageItemTable.tsx +148 -0
  33. package/template/asset-manage-template/src/components/bidPackage__c/index.tsx +394 -0
  34. package/template/asset-manage-template/src/components/bidPackage__c/mainTableColumns.tsx +57 -0
  35. package/template/asset-manage-template/src/components/bidPackage__c/model.ts +86 -0
  36. package/template/asset-manage-template/src/components/bidPackage__c/style.scss +256 -0
  37. package/template/asset-manage-template/src/components/bidPackage__c/types.ts +35 -0
  38. package/template/asset-manage-template/src/components/bidPackage__c/utils.ts +19 -0
  39. package/template/{neo-bi-cmps → asset-manage-template}/src/utils/axiosFetcher.ts +0 -0
  40. package/template/{neo-bi-cmps → asset-manage-template}/src/utils/queryObjectData.ts +0 -0
  41. package/template/asset-manage-template/src/utils/url.ts +82 -0
  42. package/template/{neo-bi-cmps → asset-manage-template}/src/utils/xobjects.ts +0 -0
  43. package/template/{neo-bi-cmps → asset-manage-template}/tsconfig.json +1 -1
  44. package/template/echarts-custom-cmp-template/package.json +1 -1
  45. package/template/empty-custom-cmp-template/package.json +2 -2
  46. package/template/neo-custom-cmp-template/package.json +2 -2
  47. package/template/neo-custom-cmp-template/src/components/entityTable__c/index.tsx +62 -6
  48. package/template/neo-h5-cmps/neo.config.js +34 -76
  49. package/template/neo-h5-cmps/package.json +7 -3
  50. package/template/neo-h5-cmps/src/components/entityList__c/index.tsx +0 -4
  51. package/template/neo-h5-cmps/src/components/entityList__c/model.ts +10 -5
  52. package/template/neo-h5-cmps/src/components/entityTabs__c/index.tsx +29 -17
  53. package/template/neo-h5-cmps/src/components/entityTabs__c/model.ts +25 -5
  54. package/template/neo-h5-cmps/src/components/entityTabs__c/style.scss +11 -22
  55. package/template/neo-h5-cmps/src/components/openChatPageBtn__c/index.tsx +3 -1
  56. package/template/neo-h5-cmps/src/utils/xobjects.ts +8 -3
  57. package/template/neo-h5-cmps/tsconfig.json +1 -1
  58. package/template/neo-order-cmps/package.json +2 -2
  59. package/template/react-custom-cmp-template/package.json +1 -1
  60. package/template/react-ts-custom-cmp-template/package.json +1 -1
  61. package/template/vue2-custom-cmp-template/package.json +1 -1
  62. package/template/develop/BI /351/241/271/347/233/256/345/210/206/346/236/220/346/212/245/345/221/212.md" +0 -562
  63. package/template/develop/ChatPage /347/273/204/344/273/266/344/275/277/347/224/250/350/257/264/346/230/216/346/226/207/346/241/243.md" +0 -507
  64. package/template/develop/EntityGrid Web /347/273/204/344/273/266/347/232/204/350/257/246/347/273/206/345/210/206/346/236/220/346/226/207/346/241/243.md" +0 -868
  65. package/template/develop/EntityList H5 /347/273/204/344/273/266/347/232/204/350/257/246/347/273/206/345/210/206/346/236/220/346/226/207/346/241/243.md" +0 -1386
  66. package/template/develop/GlobalSearch/347/273/204/344/273/266/345/257/271/346/257/224/345/210/206/346/236/220.md +0 -866
  67. package/template/develop/Neo /344/270/255/345/217/257/347/224/250 amis /347/273/204/344/273/266.md" +0 -1490
  68. package/template/develop/cmpEventFunctions.ts +0 -257
  69. package/template/develop/cmpEvents.ts +0 -864
  70. package/template/develop/comTree/347/224/237/346/210/220/350/277/207/347/250/213/345/210/206/346/236/220.md +0 -469
  71. package/template/develop/commonModules.js +0 -55
  72. package/template/develop/components-table.md +0 -50
  73. package/template/develop/neo-custom-cmp-template/README.md +0 -48
  74. package/template/develop/neo-custom-cmp-template/docs/README.md +0 -13
  75. package/template/develop/neo-custom-cmp-template/neo.config.js +0 -121
  76. package/template/develop/neo-custom-cmp-template/package.json +0 -63
  77. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/README.md +0 -65
  78. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/index.tsx +0 -180
  79. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/model.ts +0 -50
  80. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/style.scss +0 -260
  81. package/template/develop/neo-custom-cmp-template/src/components/contactForm/README.md +0 -94
  82. package/template/develop/neo-custom-cmp-template/src/components/contactForm/index.tsx +0 -252
  83. package/template/develop/neo-custom-cmp-template/src/components/contactForm/model.ts +0 -56
  84. package/template/develop/neo-custom-cmp-template/src/components/contactForm/style.scss +0 -120
  85. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/README.md +0 -115
  86. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/index.tsx +0 -304
  87. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/model.ts +0 -87
  88. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/style.scss +0 -127
  89. package/template/develop/neo-custom-cmp-template/src/utils/axiosFetcher.ts +0 -29
  90. package/template/develop/neo-custom-cmp-template/src/utils/queryObjectData.ts +0 -39
  91. package/template/develop/neo-custom-cmp-template/src/utils/xobjects.ts +0 -203
  92. package/template/develop/neo-custom-cmp-template/tsconfig.json +0 -68
  93. package/template/develop/neo-ui-component-h5.md +0 -105
  94. package/template/develop/neo-ui-component-web-xregister.md +0 -31
  95. package/template/develop/neo-ui-component-web.md +0 -292
  96. package/template/develop/neoCmps.ts +0 -7508
  97. package/template/develop/neoGlobalSearchInput /347/273/204/344/273/266/347/232/204/350/257/246/347/273/206/345/210/206/346/236/220/346/226/207/346/241/243.md" +0 -497
  98. package/template/develop/pageSchema1.json +0 -744
  99. package/template/develop//344/272/213/344/273/266/345/212/250/344/275/234/344/277/235/345/255/230/346/265/201/347/250/213/345/210/206/346/236/220.md +0 -390
  100. package/template/develop//345/215/225/345/205/203/346/265/213/350/257/225/344/275/277/347/224/250/350/257/264/346/230/216.md +0 -1139
  101. package/template/neo-bi-cmps/.prettierrc.js +0 -12
  102. package/template/neo-bi-cmps/commitlint.config.js +0 -59
  103. package/template/neo-bi-cmps/neo.config.js +0 -124
  104. package/template/neo-bi-cmps/public/css/base.css +0 -283
  105. package/template/neo-bi-cmps/public/scripts/app/bluebird.js +0 -6679
  106. package/template/neo-bi-cmps/public/template.html +0 -13
  107. package/template/neo-bi-cmps/src/assets/css/common.scss +0 -127
  108. package/template/neo-bi-cmps/src/assets/css/mixin.scss +0 -47
  109. package/template/neo-bi-cmps/src/assets/img/NeoCRM.jpg +0 -0
  110. package/template/neo-bi-cmps/src/assets/img/custom-widget.svg +0 -1
  111. package/template/neo-bi-cmps/src/assets/img/favicon.png +0 -0
  112. package/template/neo-bi-cmps/src/assets/img/table.svg +0 -1
  113. package/template/neo-bi-cmps/src/components/targetNumber__c/README.md +0 -100
  114. package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/configSchema.ts +0 -253
  115. package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/index.scss +0 -76
  116. package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/index.tsx +0 -148
  117. package/template/neo-bi-cmps/src/components/targetNumber__c/index.tsx +0 -440
  118. package/template/neo-bi-cmps/src/components/targetNumber__c/model.ts +0 -128
  119. package/template/neo-bi-cmps/src/components/targetNumber__c/style.scss +0 -173
  120. package/template/neo-h5-cmps/src/components/simpleTable__c/README.md +0 -90
  121. package/template/neo-h5-cmps/src/components/simpleTable__c/index.tsx +0 -277
  122. package/template/neo-h5-cmps/src/components/simpleTable__c/model.ts +0 -91
  123. package/template/neo-h5-cmps/src/components/simpleTable__c/style.scss +0 -116
  124. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/.prettierrc.js +0 -0
  125. /package/template/{neo-bi-cmps → asset-manage-template}/@types/neo-ui-common.d.ts +0 -0
  126. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/commitlint.config.js +0 -0
  127. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/public/css/base.css +0 -0
  128. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/public/scripts/app/bluebird.js +0 -0
  129. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/public/template.html +0 -0
  130. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/css/common.scss +0 -0
  131. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/css/mixin.scss +0 -0
  132. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/AIBtn.gif +0 -0
  133. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/NeoCRM.jpg +0 -0
  134. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/aiLogo.png +0 -0
  135. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/card-list.svg +0 -0
  136. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/contact-form.svg +0 -0
  137. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/custom-form.svg +0 -0
  138. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/custom-widget.svg +0 -0
  139. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/data-list.svg +0 -0
  140. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/detail.svg +0 -0
  141. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/favicon.png +0 -0
  142. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/map.svg +0 -0
  143. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/search.svg +0 -0
  144. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/table.svg +0 -0
@@ -0,0 +1,244 @@
1
+ ## Open api 文档
2
+ - [Open API 简介](https://doc.xiaoshouyi.com/#/proMan/workplaceDetailApi?url=%2F%2Fconcepts%2Fapi_apiIntroduction.html&id=1405&dir=output_1757929564205)。
3
+
4
+ ## Neo 自定义组件中可用的 open api 接口
5
+ - [查询对象列表](https://doc.xiaoshouyi.com/#/proMan/workplaceDetailApi?url=%2F%2Fconcepts%2FpaasQueryObjectList.html&id=1405&dir=output_1757929564205&time=1758780224026): /rest/metadata/v2.0/xobjects/filter;
6
+ - 查询标准对象列表: /rest/metadata/v2.0/xobjects/filter?custom=false&active=true;
7
+ - 查询自定义对象列表: /rest/metadata/v2.0/xobjects/filter?custom=true&active=true;
8
+ - [创建业务数据](https://doc.xiaoshouyi.com/#/proMan/workplaceDetailApi?url=%2F%2Fconcepts%2Fapi_paas_customObject_create.html&id=1405&dir=output_1757929564205&time=1758782257815): /rest/data/v2.0/xobjects/{xObjectApiKey};
9
+ - [更新业务数据](https://doc.xiaoshouyi.com/#/proMan/workplaceDetailApi?url=%2F%2Fconcepts%2Fapi_paas_customObject_update.html&id=1405&dir=output_1757929564205&time=1758782321910): /rest/data/v2.0/xobjects/{xObjectApiKey}/{id};
10
+ - [获取业务数据信息(单个数据)](https://doc.xiaoshouyi.com/#/proMan/workplaceDetailApi?url=%2F%2Fconcepts%2Fapi_paas_customObject_getBusinessDataInformation.html&id=1405&dir=output_1757929564205&time=1758781533725): /rest/data/v2.0/xobjects/{xObjectApiKey}/{id};
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
+ - [获取业务类型描述](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
+ - 更多可用接口见[文档](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
+
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+ const path = require('path');
3
+ const fs = require('fs');
4
+
5
+ // 统一路径解析
6
+ function resolve(dir) {
7
+ return path.resolve(__dirname, dir);
8
+ }
9
+
10
+ // 包括生产和开发的环境配置信息
11
+ module.exports = {
12
+ settings: {
13
+ enableESLint: false,
14
+ enableESLintFix: false,
15
+ enableStyleLint: false,
16
+ enableStyleLintFix: false
17
+ },
18
+ webpack: {
19
+ target: [
20
+ "web",
21
+ "es5"
22
+ ],
23
+ resolve: {
24
+ extensions: [
25
+ ".js",
26
+ ".jsx",
27
+ ".ts",
28
+ ".tsx",
29
+ ".umd.js",
30
+ ".min.js",
31
+ ".json"
32
+ ],
33
+ alias: {
34
+ "@": resolve("./src"),
35
+ $assets: resolve("./src/assets"),
36
+ $public: resolve("./public"),
37
+ $utils: resolve("./src/utils")
38
+ }
39
+ },
40
+ sassResources: [
41
+ resolve("./src/assets/css/common.scss"),
42
+ resolve("./src/assets/css/mixin.scss")
43
+ ],
44
+ ignoreNodeModules: false,
45
+ allowList: []
46
+ },
47
+ linkDebug: {},
48
+ neoConfig: {
49
+ neoBaseURL: "https://crm-test.xiaoshouyi.com",
50
+ loginURL: "https://login-test.xiaoshouyi.com/auc/oauth2/auth",
51
+ tokenURL: "https://login-test.xiaoshouyi.com/auc/oauth2/token"
52
+ },
53
+ pushCmp: {},
54
+ preview: {},
55
+ neoCommonModule: {
56
+ exports: {
57
+ "neo-register": "neo-register"
58
+ }
59
+ }
60
+ };
@@ -1,13 +1,14 @@
1
1
  {
2
- "name": "neo-bi-cmps",
3
- "version": "1.0.9",
4
- "description": "neo BI 自定义组件(react&ts技术栈)",
2
+ "name": "asset-manage-template",
3
+ "version": "1.0.0",
4
+ "description": "neo 自定义组件",
5
5
  "framework": "react-ts",
6
6
  "keywords": [
7
- "react&ts技术栈",
7
+ "react&ts 技术栈",
8
+ "neo 自定义组件",
8
9
  "neo自定义组件"
9
10
  ],
10
- "author": "wibetter",
11
+ "author": "xxx",
11
12
  "license": "MIT",
12
13
  "scripts": {
13
14
  "linkDebug": "neo linkDebug",
@@ -15,11 +16,12 @@
15
16
  "pushCmp": "neo push cmp",
16
17
  "pullCmp": "neo pull cmp",
17
18
  "deleteCmp": "neo delete cmp",
18
- "build2lib": "neo build2lib",
19
- "format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
19
+ "format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\"",
20
+ "preview": "neo preview",
21
+ "build2lib": "neo build2lib"
20
22
  },
21
23
  "files": [
22
- "lib/*"
24
+ "dist/*"
23
25
  ],
24
26
  "husky": {
25
27
  "hooks": {
@@ -36,27 +38,37 @@
36
38
  "neo-register": "^1.2.0",
37
39
  "react": "^16.9.0",
38
40
  "react-dom": "^16.9.0",
39
- "axios": "^1.7.0",
40
- "antd": "^4.9.4",
41
- "lodash": "^4.17.23",
42
- "neo-open-api": "^1.2.1",
41
+ "axios": "^0.27.2",
42
+ "antd": "4.9.4",
43
+ "lodash": "^4.17.21",
44
+ "neo-open-api": "^1.2.3",
43
45
  "@wibetter/json-editor": "^6.0.5",
44
- "tslib": "2.3.0"
46
+ "tslib": "2.3.0",
47
+ "echarts": "^5.5.1",
48
+ "moment": "^2.30.1"
45
49
  },
46
50
  "devDependencies": {
47
- "@babel/runtime": "^7.26.0",
48
51
  "@commitlint/cli": "^18.0.0",
49
52
  "@commitlint/config-conventional": "^18.0.0",
50
53
  "@types/react": "^16.9.11",
51
54
  "@types/react-dom": "^16.9.15",
52
55
  "@types/axios": "^0.14.0",
53
- "neo-cmp-cli": "^1.12.7",
56
+ "neo-cmp-cli": "^1.12.9",
54
57
  "husky": "^4.2.5",
55
58
  "lint-staged": "^10.2.9",
56
- "prettier": "^2.0.5"
59
+ "prettier": "^2.0.5",
60
+ "@babel/runtime": "^7.26.0",
61
+ "@types/echarts": "^4.9.0"
57
62
  },
58
63
  "engines": {
59
64
  "node": ">= 16.0.0",
60
65
  "npm": ">= 8.0.0"
66
+ },
67
+ "repository": {
68
+ "type": "git",
69
+ "url": "https://git@github.com:xxx/CD-TEST.git"
70
+ },
71
+ "bugs": {
72
+ "url": "https://github.com/xxx/CD-TEST/issues"
61
73
  }
62
74
  }
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1757492173072" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2395" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M929.295093 873.474968 119.673029 873.474968 63.904067 873.474968 63.904067 817.603677l0-586.341561c0-15.451584 12.484061-27.935645 27.935645-27.935645 15.451584 0 27.935645 12.484061 27.935645 27.935645l0 586.341561 809.622065 0c15.451584 0 27.935645 12.484061 27.935645 27.935645C957.230738 860.990906 944.746677 873.474968 929.295093 873.474968L929.295093 873.474968zM845.590487 761.732387l-55.87129 0c-30.800839 0-55.87129-24.968122-55.87129-55.87129L733.847906 370.940342c0-30.800839 24.968122-55.87129 55.87129-55.87129l55.87129 0c30.800839 0 55.87129 24.968122 55.87129 55.87129l0 335.023084C901.461777 736.764265 876.391326 761.732387 845.590487 761.732387L845.590487 761.732387zM566.438693 761.732387l-55.87129 0c-30.800839 0-55.87129-24.968122-55.87129-55.87129L454.696113 203.4288c0-30.800839 24.968122-55.87129 55.87129-55.87129l55.87129 0c30.800839 0 55.87129 24.968122 55.87129 55.87129l0 502.534626C622.207655 736.764265 597.239532 761.732387 566.438693 761.732387L566.438693 761.732387zM287.184571 761.732387l-55.87129 0c-30.800839 0-55.87129-24.968122-55.87129-55.87129L175.441991 482.580594c0-30.800839 24.968122-55.87129 55.87129-55.87129l55.87129 0c30.800839 0 55.87129 24.968122 55.87129 55.87129l0 223.382832C343.055861 736.764265 318.087739 761.732387 287.184571 761.732387L287.184571 761.732387z" p-id="2396" fill="#0764f5"></path></svg>
@@ -0,0 +1,3 @@
1
+ ### 目录说明
2
+ 此目录用于存放自定义组件对应的源码,每个子目录存放一个自定义组件,
3
+ 存放在此的自定义组件在发布时会自动注册成 NeoCRM 平台可用的自定义组件。
@@ -0,0 +1,70 @@
1
+ /**
2
+ * 资产 / 分类数据请求(无 mock 回退)
3
+ */
4
+ // @ts-ignore
5
+ import { xObject } from 'neo-open-api';
6
+ import type { AssetItem, CategoryItem, FilterParams } from './types';
7
+ import { DEFAULT_ASSET_FIELDS } from './constants';
8
+
9
+ export async function fetchCategories(
10
+ categoryApiKey: string,
11
+ ): Promise<CategoryItem[]> {
12
+ if (!categoryApiKey) return [];
13
+ const result = await xObject.query({
14
+ xObjectApiKey: categoryApiKey,
15
+ fields: ['name'],
16
+ pageSize: 100,
17
+ });
18
+ if (result?.status && Array.isArray(result.data)) {
19
+ return result.data;
20
+ }
21
+ return [];
22
+ }
23
+
24
+ export interface FetchAssetsResult {
25
+ records: AssetItem[];
26
+ total: number;
27
+ }
28
+
29
+ export async function fetchAssets(params: {
30
+ assetApiKey: string;
31
+ assetFields?: string[];
32
+ pageSize: number;
33
+ filters: FilterParams;
34
+ }): Promise<FetchAssetsResult> {
35
+ const { assetApiKey, assetFields, pageSize, filters } = params;
36
+ if (!assetApiKey) {
37
+ return { records: [], total: 0 };
38
+ }
39
+
40
+ const queryFilters: string[] = [];
41
+ if (filters.categoryId) {
42
+ queryFilters.push(`categoryId__c = ${filters.categoryId}`);
43
+ }
44
+ if (filters.status != null) {
45
+ queryFilters.push(`status__c = ${filters.status}`);
46
+ }
47
+ if (filters.keyword) {
48
+ queryFilters.push(
49
+ `(name like '${filters.keyword}%' or serialNumber__c like '${filters.keyword}%')`,
50
+ );
51
+ }
52
+
53
+ const queryParams: any = {
54
+ xObjectApiKey: assetApiKey,
55
+ fields: assetFields?.length ? assetFields : DEFAULT_ASSET_FIELDS,
56
+ pageSize,
57
+ };
58
+ if (queryFilters.length > 0) {
59
+ queryParams.where = queryFilters;
60
+ }
61
+
62
+ const result = await xObject.query(queryParams);
63
+ if (result?.status) {
64
+ return {
65
+ records: result.data || [],
66
+ total: result.totalSize ?? (result.data || []).length,
67
+ };
68
+ }
69
+ return { records: [], total: 0 };
70
+ }