neo-cmp-cli 1.13.19 → 1.13.21

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 (34) hide show
  1. package/README.md +206 -609
  2. package/dist/config/auth.config.js +1 -1
  3. package/dist/neo/neoRequire.js +1 -1
  4. package/dist/package.json.js +1 -1
  5. package/package.json +1 -2
  6. package/template/antd-custom-cmp-template/package.json +1 -1
  7. package/template/asset-manage-template/package.json +2 -2
  8. package/template/echarts-custom-cmp-template/package.json +1 -1
  9. package/template/empty-custom-cmp-template/package.json +2 -2
  10. package/template/map-custom-cmp-template/package.json +1 -1
  11. package/template/neo-bi-cmps/package.json +2 -2
  12. package/template/neo-custom-cmp-template/package.json +2 -2
  13. package/template/neo-custom-cmp-template/src/components/customApi__c/README.md +90 -0
  14. package/template/neo-custom-cmp-template/src/components/customApi__c/index.tsx +184 -0
  15. package/template/neo-custom-cmp-template/src/components/customApi__c/model.ts +53 -0
  16. package/template/neo-custom-cmp-template/src/components/customApi__c/style.scss +116 -0
  17. package/template/neo-custom-cmp-template/src/components/entityTable__c/index.tsx +5 -1
  18. package/template/neo-custom-cmp-template/src/components/simpleCmp__c/index.tsx +4 -1
  19. package/template/neo-h5-cmps/neo.config.js +1 -1
  20. package/template/neo-h5-cmps/package.json +2 -2
  21. package/template/neo-h5-cmps/src/components/entityList__c/index.tsx +0 -1
  22. package/template/neo-order-cmps/package.json +2 -2
  23. package/template/neo-pipeline-cmps/package.json +2 -2
  24. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/index.tsx +2 -1
  25. package/template/neo-web-entity-grid/package.json +2 -2
  26. package/template/neo-web-form/package.json +2 -2
  27. package/template/react-custom-cmp-template/package.json +1 -1
  28. package/template/react-ts-custom-cmp-template/package.json +1 -1
  29. package/template/vue2-custom-cmp-template/package.json +1 -1
  30. package/docs/H5/347/253/257 NeoEntityList /344/275/277/347/224/250/350/257/264/346/230/216.md" +0 -293
  31. package/docs/Web/347/253/257 NeoEntityGrid /344/275/277/347/224/250/350/257/264/346/230/216.md" +0 -1206
  32. package/docs//345/217/257/347/224/250/345/261/236/346/200/247/351/205/215/347/275/256/351/241/271.md +0 -801
  33. package/docs//351/200/232/347/224/250/344/273/243/347/220/206/346/216/245/345/217/243/forward.zip +0 -0
  34. package/docs//351/200/232/347/224/250/344/273/243/347/220/206/346/216/245/345/217/243//350/207/252/345/256/232/344/271/211API:/351/200/232/347/224/250/344/273/243/347/220/206/346/216/245/345/217/243/344/275/277/347/224/250/350/257/264/346/230/216.md +0 -13
@@ -38,7 +38,7 @@
38
38
  "echarts": "^5.6.0",
39
39
  "lodash": "^4.17.21",
40
40
  "moment": "^2.30.1",
41
- "neo-open-api": "^1.2.7",
41
+ "neo-open-api": "^1.2.8",
42
42
  "neo-register": "^1.1.3",
43
43
  "react": "^16.9.0",
44
44
  "react-dom": "^16.9.0",
@@ -53,7 +53,7 @@
53
53
  "@types/react-dom": "^16.9.15",
54
54
  "husky": "^4.2.5",
55
55
  "lint-staged": "^10.2.9",
56
- "neo-cmp-cli": "^1.13.17",
56
+ "neo-cmp-cli": "^1.13.21",
57
57
  "prettier": "^2.0.5"
58
58
  },
59
59
  "overrides": {
@@ -185,6 +185,7 @@ function buildHealthRadarOption(
185
185
  return {
186
186
  tooltip: {
187
187
  trigger: 'item',
188
+ position: 'inside',
188
189
  },
189
190
  radar: {
190
191
  indicator,
@@ -212,7 +213,7 @@ function buildHealthRadarOption(
212
213
  data: [
213
214
  {
214
215
  value: items.map((i) => i.score),
215
- name: 'Health Score',
216
+ name: 'Opportunity Health',
216
217
  areaStyle: {
217
218
  color: 'rgba(99,102,241,0.2)',
218
219
  },
@@ -37,7 +37,7 @@
37
37
  "antd": "^4.9.4",
38
38
  "axios": "^1.7.0",
39
39
  "lodash": "^4.17.23",
40
- "neo-open-api": "^1.2.7",
40
+ "neo-open-api": "^1.2.9",
41
41
  "neo-register": "^1.2.0",
42
42
  "react": "^16.9.0",
43
43
  "react-dom": "^16.9.0",
@@ -52,7 +52,7 @@
52
52
  "@types/react-dom": "^16.9.15",
53
53
  "husky": "^4.2.5",
54
54
  "lint-staged": "^10.2.9",
55
- "neo-cmp-cli": "^1.13.17",
55
+ "neo-cmp-cli": "^1.13.21",
56
56
  "prettier": "^2.0.5"
57
57
  },
58
58
  "overrides": {
@@ -37,7 +37,7 @@
37
37
  "antd": "^4.9.4",
38
38
  "axios": "^1.7.0",
39
39
  "lodash": "^4.17.23",
40
- "neo-open-api": "^1.2.7",
40
+ "neo-open-api": "^1.2.9",
41
41
  "neo-register": "^1.2.0",
42
42
  "react": "^16.9.0",
43
43
  "react-dom": "^16.9.0",
@@ -53,7 +53,7 @@
53
53
  "@types/react-dom": "^16.9.15",
54
54
  "husky": "^4.2.5",
55
55
  "lint-staged": "^10.2.9",
56
- "neo-cmp-cli": "^1.13.18",
56
+ "neo-cmp-cli": "^1.13.21",
57
57
  "prettier": "^2.0.5"
58
58
  },
59
59
  "overrides": {
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@commitlint/cli": "^18.0.0",
47
47
  "@commitlint/config-conventional": "^18.0.0",
48
- "neo-cmp-cli": "^1.13.18",
48
+ "neo-cmp-cli": "^1.13.21",
49
49
  "husky": "^4.2.5",
50
50
  "lint-staged": "^10.2.9",
51
51
  "prettier": "^2.0.5"
@@ -47,7 +47,7 @@
47
47
  "@commitlint/config-conventional": "^18.0.0",
48
48
  "@types/react": "^16.9.11",
49
49
  "@types/react-dom": "^16.9.15",
50
- "neo-cmp-cli": "^1.13.17",
50
+ "neo-cmp-cli": "^1.13.21",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5"
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@commitlint/cli": "^18.0.0",
47
47
  "@commitlint/config-conventional": "^18.0.0",
48
- "neo-cmp-cli": "^1.13.17",
48
+ "neo-cmp-cli": "^1.13.21",
49
49
  "husky": "^4.2.5",
50
50
  "lint-staged": "^10.2.9",
51
51
  "prettier": "^2.0.5",
@@ -1,293 +0,0 @@
1
- # H5 端 NeoEntityList 使用说明
2
-
3
- ## 目录
4
-
5
- - [一、组件概述](#一组件概述)
6
- - [技术栈](#技术栈)
7
- - [二、核心功能](#二核心功能)
8
- - [1. 列表类型与展示](#1-列表类型与展示)
9
- - [2. 数据与分页](#2-数据与分页)
10
- - [3. SmartView、搜索、筛选与排序](#3-smartview搜索筛选与排序)
11
- - [4. 批量操作与按钮区](#4-批量操作与按钮区)
12
- - [5. 列表项交互与详情](#5-列表项交互与详情)
13
- - [三、组件属性说明](#三组件属性说明)
14
- - [NeoEntityList 封装层属性](#neoentitylist-封装层属性)
15
- - [额外透传至 EntityList 的属性](#额外透传至-entitylist-的属性)
16
- - [透传范围说明](#透传范围说明)
17
- - [四、核心回调说明](#四核心回调说明)
18
- - [onItemClickIntercept — 列表项点击拦截](#onitemclickintercept--列表项点击拦截)
19
- - [onSearchDataComplete — 列表数据请求完成](#onsearchdatacomplete--列表数据请求完成)
20
- - [五、完整使用示例](#五完整使用示例)
21
- - [示例 1:基础实体列表](#示例-1基础实体列表)
22
- - [示例 2:精简展示(无标题区、无视图切换)](#示例-2精简展示无标题区无视图切换)
23
- - [示例 3:关闭搜索 / 排序 / 筛选与下拉刷新](#示例-3关闭搜索--排序--筛选与下拉刷新)
24
- - [示例 4:拦截列表项点击(不打开详情)](#示例-4拦截列表项点击不打开详情)
25
- - [六、注意事项](#六注意事项)
26
- - [1. render 必传](#1-render-必传)
27
- - [2. Store 与注册](#2-store-与注册)
28
- - [3. skipExt 与 Nex](#3-skipext-与-nex)
29
- - [4. 高度与滚动(autoHeight)](#4-高度与滚动autoheight)
30
- - [5. 需要完整 EntityList 能力时](#5-需要完整-entitylist-能力时)
31
- - [七、常见问题](#七常见问题)
32
- - [Q1: 点击列表项如何阻止默认打开详情?](#q1-点击列表项如何阻止默认打开详情)
33
- - [Q2: 如何监听每次列表数据加载完成?](#q2-如何监听每次列表数据加载完成)
34
- - [Q3: 为什么传入的部分 props 未生效?](#q3-为什么传入的部分-props-未生效)
35
- - [Q4: 与直接使用 type: 'EntityList' 的 Schema 有何区别?](#q4-与直接使用-type-entitylist-的-schema-有何区别)
36
- - [八、总结](#八总结)
37
-
38
- ## 一、组件概述
39
-
40
- `NeoEntityList`是对 H5 业务组件 **`EntityList`** 的二次封装,支持在「自定义组件」中通过 **import 代码方式**使用。
41
-
42
- 底层 `EntityList` 使用 **卡片式列表** 展示列表数据,支持 SmartView 切换、搜索、筛选、排序、批量操作、下拉刷新与上拉加载等能力。
43
-
44
- ### 技术栈
45
-
46
- - **React**:类组件封装(继承 `BaseCmp`)
47
- - **MobX / MST**:底层 `EntityList` 与 `EntityListStore` 状态管理
48
- - **amis**:通过 `props.render` 渲染 `EntityList` Schema
49
- - **TypeScript**:与 `RendererProps` 等类型配合使用
50
-
51
- ## 二、核心功能
52
-
53
- ### 1. 列表类型与展示
54
-
55
- - 固定为 **大列表** 场景(`tableType: 'list'`),列表项为 **卡片** 形态。
56
- - 可通过 `disableTitleView`、`isShowTitlePicker` 控制 **标题区** 与 **视图切换(Picker)** 是否展示(封装内默认:隐藏标题区、不展示视图 Picker,详情见属性表)。
57
-
58
- ### 2. 数据与分页
59
-
60
- - 数据通过 **`EntityListStore`** 拉取布局与列表数据,支持分页。
61
- - `pageSize` 对应请求中的每页条数(内部默认 20)。
62
- - `isNoRefresh` 为 `true` 时 **禁用下拉刷新与上拉加载**。
63
-
64
- ### 3. SmartView、搜索、筛选与排序
65
-
66
- - 支持 **SmartView** 及对应的数据范围与列配置(是否展示视图切换受 `disableTitleView` / `isShowTitlePicker` 等影响)。
67
- - `disableSearch`:隐藏顶部搜索相关能力。
68
- - `disabledSort` / `disabledFilter`:隐藏列表上的 **排序** / **筛选** 控件(与《详细分析文档》中「筛选和排序」章节一致)。
69
-
70
- ### 4. 批量操作与按钮区
71
-
72
- - `disabledOperationBtn`:为 `true` 时隐藏 **操作按钮区域**(如新建、批量操作等,具体以产品实现为准)。
73
- - `disabledShortcutBtn`:为 `true` 时隐藏 **快捷按钮区域**。
74
-
75
- ### 5. 列表项交互与详情
76
-
77
- - 默认点击列表项会通过 `NeoNavigator.openEntityDetail` 打开实体详情。
78
- - 可通过 **`onItemClickIntercept`** 拦截:返回真值时 **不执行**默认打开详情逻辑(见下文)。
79
-
80
- ## 三、组件属性说明
81
-
82
- ### 基础配置属性
83
-
84
- | 属性名 | 类型 | 默认值 | 说明 |
85
- |--------|------|--------|------|
86
- | `entityApiKey` | `string` | (必填) | 实体 ApiKey;同时作为 `objectApiKey` 传入 `EntityList` |
87
- | `render` | `Function` | (必填) | amis 注入的渲染函数,**必传**,通常为 `this.props.render` 或 `props.render` |
88
- | `disableTitleView` | `boolean` | `true` | 为 `true` 时隐藏 **标题区域**(封装默认隐藏,需标题时可传 `false`) |
89
- | `isShowTitlePicker` | `boolean` | `false` | 为 `true` 时展示 **切换视图的 Picker** |
90
- | `disableSearch` | `boolean` | `false` | 为 `true` 时不展示搜索框 |
91
- | `disabledSort` | `boolean` | `false` | 为 `true` 时不展示列表 **排序** 组件 |
92
- | `disabledFilter` | `boolean` | `false` | 为 `true` 时不展示列表 **筛选** 组件 |
93
- | `disabledOperationBtn` | `boolean` | `false` | 为 `true` 时隐藏 **操作按钮区**(含新建、批量操作等) |
94
- | `disabledShortcutBtn` | `boolean` | `false` | 为 `true` 时隐藏 **快捷按钮区** |
95
- | `pageSize` | `number` | 未传则走内部默认 | 每页加载条数(search 接口 `page.pageSize`) |
96
- | `isNoRefresh` | `boolean` | `false` | 为 `true` 时禁用 **下拉刷新** 与 **上拉加载** |
97
- | `autoHeight` | `boolean` | `false` | 为 `true` 时外层高度为 `auto`,列表区域使用 **body 滚动**(与 `EntityList` 一致) |
98
-
99
- ### 其他可用属性
100
-
101
- | 属性名 | 类型 | 说明 |
102
- |--------|------|------|
103
- | `onItemClickIntercept` | `Function` | 列表项点击拦截,见 [四、核心回调说明](#四核心回调说明) |
104
- | `onSearchDataComplete` | `Function` | 列表数据请求完成回调,见 [四、核心回调说明](#四核心回调说明) |
105
- | `style` | `object` | 自定义样式对象,传入 `EntityList` |
106
-
107
- ## 四、核心回调说明
108
-
109
- ### onItemClickIntercept — 列表项点击拦截
110
-
111
- **作用**:在用户点击列表项准备打开详情 **之前** 调用;若返回 **真值**(truthy),则 **不会** 执行默认的 `NeoNavigator.openEntityDetail`。
112
-
113
- **函数签名(典型用法)**:
114
-
115
- ```typescript
116
- onItemClickIntercept?: (data: any, entity: any, context?: any) => any
117
- ```
118
-
119
- **参数说明**:
120
-
121
- - `data`:当前行 / 卡片对应的数据(含 `id`、`entityType` 等)。
122
- - `entity`:实体元数据相关信息(含 `apiKey` 等)。
123
- - `context`:部分调用路径会传入 amis `context`(与 `EntityList` 内 `listItemClick` 实现一致)。
124
-
125
- **实现逻辑(与 EntityList 一致)**:
126
-
127
- ```text
128
- result = onItemClickIntercept?.(data, entity, context)
129
- 若 result 为真 → 不打开详情
130
- 否则 → NeoNavigator.openEntityDetail(...)
131
- ```
132
-
133
- **使用示例**见 [示例 4](#示例-4拦截列表项点击不打开详情)。
134
-
135
- ---
136
-
137
- ### onSearchDataComplete — 列表数据请求完成
138
-
139
- **作用**:在列表数据请求流程中作为回调传入 Store,用于在 **数据刷新、加载** 等完成后执行自定义逻辑(例如刷新汇总、埋点等)。具体调用链与 `EntityList` / `EntityListStore` 内 `getListData`、`refreshListData` 一致,详见《EntityList H5 组件的详细分析文档》。
140
-
141
- **函数签名(示意)**:
142
-
143
- ```typescript
144
- onSearchDataComplete?: (data?: any) => void
145
- ```
146
-
147
- ## 五、完整使用示例
148
-
149
- 以下示例均在自定义组件中挂载 **`NeoEntityList`**,并从 **`neo-ui-component-h5`** 引用。
150
-
151
- > **说明**:`render` 必须为框架注入的 `this.props.render`(类组件)或 `props.render`(函数组件),否则子 Schema 无法渲染。
152
-
153
- ### 示例 1:基础实体列表
154
-
155
- ```tsx
156
- import * as React from 'react'
157
- import { NeoEntityList } from 'neo-ui-component-h5'
158
-
159
- interface Props {
160
- render: (name: string, schema: object) => React.ReactNode
161
- }
162
-
163
- export default class AccountNeoEntityListBasic extends React.Component<Props> {
164
- render() {
165
- return (
166
- <NeoEntityList
167
- render={this.props.render}
168
- entityApiKey="account"
169
- disableTitleView={false}
170
- isShowTitlePicker
171
- />
172
- )
173
- }
174
- }
175
- ```
176
-
177
- ### 示例 2:精简展示(无标题区、无视图切换)
178
-
179
- ```tsx
180
- import * as React from 'react'
181
- import { NeoEntityList } from 'neo-ui-component-h5'
182
-
183
- export default class ContactNeoEntityListMinimal extends React.Component<{ render: any }> {
184
- render() {
185
- return (
186
- <NeoEntityList
187
- render={this.props.render}
188
- entityApiKey="contact"
189
- disableTitleView
190
- isShowTitlePicker={false}
191
- style={{ minHeight: 200 }}
192
- />
193
- )
194
- }
195
- }
196
- ```
197
-
198
- ### 示例 3:关闭搜索 / 排序 / 筛选与下拉刷新
199
-
200
- ```tsx
201
- import * as React from 'react'
202
- import { NeoEntityList } from 'neo-ui-component-h5'
203
-
204
- export default class LeadNeoEntityListNoChrome extends React.Component<{ render: any }> {
205
- render() {
206
- return (
207
- <NeoEntityList
208
- render={this.props.render}
209
- entityApiKey="lead"
210
- disableSearch
211
- disabledSort
212
- disabledFilter
213
- isNoRefresh
214
- pageSize={15}
215
- />
216
- )
217
- }
218
- }
219
- ```
220
-
221
- ### 示例 4:拦截列表项点击(不打开详情)
222
-
223
- ```tsx
224
- import * as React from 'react'
225
- import { NeoEntityList } from 'neo-ui-component-h5'
226
-
227
- export default class OpportunityNeoEntityListIntercept extends React.Component<{ render: any }> {
228
- render() {
229
- return (
230
- <NeoEntityList
231
- render={this.props.render}
232
- entityApiKey="opportunity"
233
- onItemClickIntercept={(data, entity) => {
234
- console.log('点击列表项', data, entity)
235
- // 返回 true 拦截默认打开详情
236
- return true
237
- }}
238
- onSearchDataComplete={(payload) => {
239
- console.log('列表数据请求完成', payload)
240
- }}
241
- />
242
- )
243
- }
244
- }
245
- ```
246
-
247
- ## 六、注意事项
248
-
249
- ### 1. render 必传
250
-
251
- 在 Neo 自定义组件内使用 `NeoEntityList` 时,**必须**传入 `render={this.props.render}`(或函数组件的 `props.render`),用于渲染 `EntityList` 及其内部 amis 子节点。
252
-
253
- ### 2. Store 与注册
254
-
255
- 底层使用 `NeoRegister` 注册的 **`EntityList`**,且 `storeType` 为 **`EntityListStore`**;由 amis / Neo 运行时按规则创建与注入,**无需**在业务侧手动 `EntityListStore.create`。
256
-
257
- ### 3. skipExt 与 Nex
258
-
259
- `NeoEntityList` 生成的 Schema 含 **`skipExt: true`**:实体类 HOC 在 `skipExt` 为真时 **不再合并** 页面级 Nex 扩展配置,直接渲染组件(见 `neo-ui-common` 中 `EntityHoc` 的 `render` 分支)。本文档 **不包含** Nex 扩展点与脚本侧 API 说明。
260
-
261
- ### 4. 高度与滚动(autoHeight)
262
-
263
- - `autoHeight={false}`(默认):列表区域在组件内部滚动(具体以 `EntityList` 布局为准)。
264
- - `autoHeight={true}`:外层高度随内容变化,列表使用 **body 滚动**,适用于嵌入长页面等场景。
265
-
266
- ### 5. 需要完整 EntityList 能力时
267
-
268
- 若需使用 `requestParams`、`referConditions`、`ListItemSchema`、`expandSchemas` 等 **未在 NeoEntityList 中透传** 的属性,请优先在页面 Schema 中配置完整 **`EntityList`**,或扩展封装组件。
269
-
270
- ## 七、常见问题
271
-
272
- ### Q1: 点击列表项如何阻止默认打开详情?
273
-
274
- **A**:在 `onItemClickIntercept` 中返回 **真值**(例如 `true`)。返回假值或不返回时,仍会走默认 `NeoNavigator.openEntityDetail`。
275
-
276
- ### Q2: 如何监听每次列表数据加载完成?
277
-
278
- **A**:使用 **`onSearchDataComplete`**,其会随 Store 的数据请求流程被调用(与《详细分析文档》中 Store 行为一致)。若需更细粒度事件,需在页面侧使用完整 `EntityList` 或扩展封装。
279
-
280
- ### Q3: 为什么传入的部分 props 未生效?
281
-
282
- **A**:当前 `NeoEntityList` 只对 [封装层属性](#neoentitylist-封装层属性) 与 **`onItemClickIntercept` / `onSearchDataComplete` / `style`** 进行合并,其余属性会被忽略。
283
-
284
- ### Q4: 与直接使用 type: 'EntityList' 的 Schema 有何区别?
285
-
286
- **A**:`NeoEntityList` 适合 **代码 import**、固定 **大列表** 且希望 **跳过 Nex 合并**、且只需要 **少量开关与回调** 的场景;完整 Schema 方式可配置 **全部** `EntityList` 属性与事件。
287
-
288
- ## 八、总结
289
-
290
- - **`NeoEntityList`** 是 H5 **`EntityList`** 的轻量封装,固定 **`tableType: 'list'`**,并设置 **`skipExt: true`**,便于在自定义组件中快速挂载实体卡片列表。
291
- - 使用前务必传入 **`render`** 与 **`entityApiKey`**,并按需配置 **标题区、搜索、排序、筛选、操作区、刷新与分页** 等开关。
292
- - **点击拦截** 与 **数据完成回调** 请使用 **`onItemClickIntercept`**、**`onSearchDataComplete`**。
293
- - 需要 **完整列表能力** 或 **更多透传字段** 时,请使用 **`type: 'EntityList'`** 或扩展 **`NeoEntityList`** 实现。