neo-cmp-cli 1.13.17 → 1.13.18

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 (71) hide show
  1. package/dist/index2.js +1 -1
  2. package/dist/neo/env.js +1 -1
  3. package/dist/neo/pushCmp.js +1 -1
  4. package/dist/package.json.js +1 -1
  5. package/package.json +3 -2
  6. package/template/asset-manage-template/docs/README.md +1 -232
  7. package/template/echarts-custom-cmp-template/package.json +1 -1
  8. package/template/neo-bi-cmps/package.json +1 -1
  9. package/template/neo-bi-cmps/src/components/targetNumber__c/model.ts +1 -1
  10. package/template/neo-custom-cmp-template/docs/README.md +0 -231
  11. package/template/neo-custom-cmp-template/package.json +1 -1
  12. package/template/neo-h5-cmps/src/components/entityList__c/index.tsx +1 -2
  13. package/template/neo-h5-cmps/src/components/entityTabs__c/index.tsx +1 -1
  14. package/template/neo-h5-cmps/src/components/globalSearchInput__c/index.tsx +1 -1
  15. package/template/neo-h5-cmps/src/components/openChatPageBtn__c/index.tsx +1 -2
  16. package/template/neo-pipeline-cmps/neo.config.js +11 -0
  17. package/template/neo-pipeline-cmps/src/assets/css/common.scss +16 -16
  18. package/template/neo-pipeline-cmps/src/assets/css/mixin.scss +5 -5
  19. package/template/neo-pipeline-cmps/src/components/filterBar__c/README.md +9 -9
  20. package/template/neo-pipeline-cmps/src/components/filterBar__c/common.scss +5 -5
  21. package/template/neo-pipeline-cmps/src/components/filterBar__c/index.tsx +47 -46
  22. package/template/neo-pipeline-cmps/src/components/filterBar__c/model.ts +13 -11
  23. package/template/neo-pipeline-cmps/src/components/filterBar__c/style.scss +1 -1
  24. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/README.md +17 -17
  25. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/index.tsx +23 -22
  26. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/model.ts +18 -17
  27. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/index.tsx +33 -26
  28. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/model.ts +9 -9
  29. package/template/neo-pipeline-cmps/src/components/simpleTable__c/README.md +53 -54
  30. package/template/neo-pipeline-cmps/src/components/simpleTable__c/common.scss +5 -5
  31. package/template/neo-pipeline-cmps/src/components/simpleTable__c/index.tsx +70 -68
  32. package/template/neo-pipeline-cmps/src/components/simpleTable__c/model.ts +41 -41
  33. package/template/neo-pipeline-cmps/src/components/simpleTable__c/style.scss +2 -3
  34. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/README.md +15 -15
  35. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/index.tsx +35 -33
  36. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/model.ts +16 -15
  37. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/README.md +18 -18
  38. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/index.tsx +20 -20
  39. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/model.ts +21 -18
  40. package/template/neo-pipeline-cmps/src/utils/common.ts +14 -14
  41. package/template/neo-pipeline-cmps/src/utils/filter2chartFilter.ts +21 -23
  42. package/template/neo-pipeline-cmps/src/utils/filterBar.ts +14 -14
  43. package/template/neo-pipeline-cmps/src/utils/pipelineFunnel.ts +5 -5
  44. package/template/neo-pipeline-cmps/src/utils/queryByCustomSQL.ts +26 -22
  45. package/template/neo-pipeline-cmps/src/utils/requestDebounce.ts +3 -3
  46. package/template/neo-pipeline-cmps/src/utils/simpleTable.tsx +31 -26
  47. package/template/neo-pipeline-cmps/src/utils/stageSwitch.ts +1 -1
  48. package/template/neo-pipeline-cmps/src/utils/stageTimeChart.ts +5 -5
  49. package/template/neo-pipeline-cmps/src/utils/targetNumber.ts +2 -2
  50. package/template/neo-web-form/package.json +1 -1
  51. package/template/neo-web-form/src/components/batchAddTable__c/index.tsx +161 -41
  52. package/template/neo-web-form/src/components/batchAddTable__c/model.ts +4 -2
  53. package/template/react-custom-cmp-template/package.json +1 -1
  54. package/template/asset-manage-template/src/utils/axiosFetcher.ts +0 -37
  55. package/template/asset-manage-template/src/utils/queryObjectData.ts +0 -112
  56. package/template/asset-manage-template/src/utils/xobjects.ts +0 -162
  57. package/template/neo-custom-cmp-template/src/utils/axiosFetcher.ts +0 -37
  58. package/template/neo-custom-cmp-template/src/utils/queryObjectData.ts +0 -112
  59. package/template/neo-custom-cmp-template/src/utils/xobjects.ts +0 -162
  60. package/template/neo-h5-cmps/src/utils/axiosFetcher.ts +0 -37
  61. package/template/neo-h5-cmps/src/utils/queryObjectData.ts +0 -112
  62. package/template/neo-h5-cmps/src/utils/xobjects.ts +0 -167
  63. package/template/neo-order-cmps/src/utils/axiosFetcher.ts +0 -37
  64. package/template/neo-order-cmps/src/utils/queryObjectData.ts +0 -112
  65. package/template/neo-order-cmps/src/utils/xobjects.ts +0 -162
  66. package/template/neo-web-entity-grid/src/utils/axiosFetcher.ts +0 -37
  67. package/template/neo-web-entity-grid/src/utils/queryObjectData.ts +0 -112
  68. package/template/neo-web-entity-grid/src/utils/xobjects.ts +0 -167
  69. package/template/neo-web-form/src/utils/axiosFetcher.ts +0 -37
  70. package/template/neo-web-form/src/utils/queryObjectData.ts +0 -112
  71. package/template/neo-web-form/src/utils/xobjects.ts +0 -167
@@ -1,39 +1,39 @@
1
- # XObject 数据表格组件(简化版)
1
+ # XObject Data Table Component (Simplified)
2
2
 
3
- 基于 XObject 的数据表格组件,仅支持数据展示,表格列根据 `xObject.getDesc` 返回的 fields 动态生成。
4
- 备注:使用 Neo Open API SDKneo-open-api 提供的方法实现数据对象的查询操作。
3
+ An XObject-based data table component that only supports data display. Table columns are dynamically generated based on fields returned by `xObject.getDesc`.
4
+ Note: Uses methods provided by the Neo Open API SDK (neo-open-api) to implement data object query operations.
5
5
 
6
- ## 功能特性
6
+ ## Features
7
7
 
8
- - 📊 **动态表格列**:根据 XObject 字段描述自动生成表格列
9
- - 🔍 **数据展示**:支持展示 XObject 实体数据
10
- - 🎨 **响应式设计**:适配不同屏幕尺寸
11
- - ⚙️ **属性配置**:支持通过编辑器配置组件属性
8
+ - **Dynamic Table Columns**: Automatically generates table columns based on XObject field descriptions
9
+ - **Data Display**: Supports displaying XObject entity data
10
+ - **Responsive Design**: Adapts to different screen sizes
11
+ - **Property Configuration**: Supports configuring component properties through the editor
12
12
 
13
- ## 组件属性
13
+ ## Component Properties
14
14
 
15
- | 属性名 | 类型 | 默认值 | 说明 |
16
- |--------|------|--------|------|
17
- | title | string | '数据表格' | 表格标题 |
18
- | xObjectDataApi | object | - | 实体数据源配置 |
19
- | xObjectDataApi.xObjectApiKey | string | '' | 数据对象的 API Key |
20
- | xObjectDataApi.fields | string[] | [] | 要显示的字段列表 |
15
+ | Property | Type | Default | Description |
16
+ |----------|------|---------|-------------|
17
+ | title | string | 'Data Table' | Table title |
18
+ | xObjectDataApi | object | - | Entity data source configuration |
19
+ | xObjectDataApi.xObjectApiKey | string | '' | Data object API Key |
20
+ | xObjectDataApi.fields | string[] | [] | List of fields to display |
21
21
 
22
- ## 使用方法
22
+ ## Usage
23
23
 
24
- ### 1. 在编辑器中使用
24
+ ### 1. Using in the Editor
25
25
 
26
- 1. 从组件面板拖拽 "实体数据表格(简化版)" 组件到页面
27
- 2. 在右侧属性面板中选择要操作的数据对象
28
- 3. 配置要显示的字段(可选)
29
- 4. 保存并预览
26
+ 1. Drag the "Entity Data Table (Simplified)" component from the component panel to the page
27
+ 2. Select the data object to operate on in the right property panel
28
+ 3. Configure the fields to display (optional)
29
+ 4. Save and preview
30
30
 
31
- ### 2. 代码中使用
31
+ ### 2. Using in Code
32
32
 
33
33
  ```tsx
34
34
  import SimpleTable from './components/simpleTable__c';
35
35
 
36
- // 使用组件
36
+ // Use the component
37
37
  <SimpleTable
38
38
  xObjectDataApi={{
39
39
  xObjectApiKey: 'customContact__c',
@@ -42,49 +42,48 @@ import SimpleTable from './components/simpleTable__c';
42
42
  />
43
43
  ```
44
44
 
45
- ## 技术实现
45
+ ## Technical Implementation
46
46
 
47
- ### 核心依赖
47
+ ### Core Dependencies
48
48
 
49
- - **Ant Design**:UI 组件库
50
- - **React**:前端框架
51
- - **TypeScript**:类型支持
49
+ - **Ant Design**: UI component library
50
+ - **React**: Frontend framework
51
+ - **TypeScript**: Type support
52
52
 
53
- ### 数据流程
53
+ ### Data Flow
54
54
 
55
- 1. **初始化**:组件挂载时获取字段描述
56
- 2. **列生成**:根据字段描述动态生成表格列
57
- 3. **数据加载**:使用 `xObject.query` 获取数据列表
55
+ 1. **Initialization**: Fetches field descriptions when the component mounts
56
+ 2. **Column Generation**: Dynamically generates table columns based on field descriptions
57
+ 3. **Data Loading**: Uses `xObject.query` to fetch data list
58
58
 
59
- ## 样式定制
59
+ ## Style Customization
60
60
 
61
- 组件提供了完整的 SCSS 样式文件,支持以下定制:
61
+ The component provides complete SCSS style files, supporting the following customizations:
62
62
 
63
- - 表格样式(边框、悬停效果等)
64
- - 响应式设计(移动端适配)
63
+ - Table styles (borders, hover effects, etc.)
64
+ - Responsive design (mobile adaptation)
65
65
 
66
- ## 注意事项
66
+ ## Notes
67
67
 
68
- 1. **权限要求**:确保用户有对应 XObject 的读取权限
69
- 2. **字段类型**:支持所有基础字段类型的展示
70
- 3. **错误处理**:组件内置了完善的错误处理和用户提示
68
+ 1. **Permission Requirements**: Ensure the user has read access to the corresponding XObject
69
+ 2. **Field Types**: Supports display of all basic field types
70
+ 3. **Error Handling**: The component has built-in comprehensive error handling and user prompts
71
71
 
72
- ## 与完整版组件的区别
72
+ ## Differences from Full Version
73
73
 
74
- 本简化版组件相比完整版 `entityTable__c` 组件:
74
+ This simplified version compared to the full `entityTable__c` component:
75
75
 
76
- - **不支持新增**:移除了新增记录功能
77
- - **不支持编辑**:移除了编辑记录功能
78
- - **不支持删除**:移除了删除记录功能
79
- - **不支持刷新**:移除了手动刷新按钮
80
- - **不支持分页**:移除了分页功能,显示所有数据
81
- - **仅支持展示**:专注于数据展示功能
76
+ - **No Create**: Removed record creation functionality
77
+ - **No Edit**: Removed record editing functionality
78
+ - **No Delete**: Removed record deletion functionality
79
+ - **No Refresh**: Removed manual refresh button
80
+ - **No Pagination**: Removed pagination, displays all data
81
+ - **Display Only**: Focused on data display functionality
82
82
 
83
- ## 扩展开发
83
+ ## Extension Development
84
84
 
85
- 如需扩展功能,可以:
86
-
87
- 1. **添加字段类型支持**:在 `generateColumns()` 方法中添加字段格式化逻辑
88
- 2. **自定义样式**:修改 `style.scss` 文件定制组件外观
89
- 3. **添加排序功能**:扩展表格功能支持列排序
85
+ To extend functionality, you can:
90
86
 
87
+ 1. **Add Field Type Support**: Add field formatting logic in the `generateColumns()` method
88
+ 2. **Custom Styles**: Modify the `style.scss` file to customize component appearance
89
+ 3. **Add Sorting**: Extend table functionality to support column sorting
@@ -1,13 +1,13 @@
1
- // css变量
1
+ // CSS variables
2
2
  :root {
3
3
  --background-color: #f5f6fa;
4
4
  }
5
5
 
6
- // sass变量
6
+ // SASS variables
7
7
  $background-color: #f5f6fa;
8
- // 自定义公共样式
8
+ // Custom common styles
9
9
 
10
- /* AI Win Ratehover 卡片(对齐 demo.html #winRateTooltip */
10
+ /* AI Win Rate: hover card (aligned with demo.html #winRateTooltip) */
11
11
  .simpleTable-winrate-trigger {
12
12
  cursor: pointer;
13
13
  border: none !important;
@@ -31,7 +31,7 @@ $background-color: #f5f6fa;
31
31
  }
32
32
  }
33
33
 
34
- /* 健康度列 hover:内嵌 showHealthResult__c */
34
+ /* Health score column hover: embedded showHealthResult__c */
35
35
  .simpleTable-health-popover-trigger {
36
36
  cursor: pointer;
37
37
  display: inline-block;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @file XObject 数据表格组件(简化版)
3
- * @description 基于 Neo 平台的 XObject 实体对象数据表格组件,仅支持数据展示
2
+ * @file XObject data table component (simplified version)
3
+ * @description XObject entity data table component based on the Neo platform, supports data display only
4
4
  */
5
5
  import * as React from 'react';
6
6
  import { Table, Spin, Empty, Popover } from 'antd';
@@ -9,11 +9,11 @@ import { xObject } from 'neo-open-api'; // Neo Open API
9
9
  // @ts-ignore
10
10
  import isEqual from 'lodash/isEqual';
11
11
 
12
- // Neo Open API// 引入 neo-ui-common / BaseCmp
12
+ // Neo Open API// Import neo-ui-common / BaseCmp
13
13
  // @ts-ignore
14
14
  import { BaseCmp } from 'neo-ui-common';
15
15
 
16
- // 引入 neo-ui-common / NeoEvent
16
+ // Import neo-ui-common / NeoEvent
17
17
  // @ts-ignore
18
18
  import { NeoEvent } from 'neo-ui-common';
19
19
 
@@ -51,7 +51,7 @@ import './style.scss';
51
51
 
52
52
  export type { HistoryOppSnap } from '../../utils/simpleTable';
53
53
 
54
- /** 商机详情页 hash 路由(与平台 neoweb 一致) */
54
+ /** Opportunity detail page hash route (consistent with platform neoweb) */
55
55
  function buildOpportunityDetailUrl(id: string, objectApiKey: string): string {
56
56
  const q = new URLSearchParams({
57
57
  objectApiKey,
@@ -60,7 +60,7 @@ function buildOpportunityDetailUrl(id: string, objectApiKey: string): string {
60
60
  return `/bff/neoweb#/entityDetail/opportunity/${id}?${q.toString()}`;
61
61
  }
62
62
 
63
- /** 不在表格中展示的字段(仍可通过 xObjectDataApi.fields 拉取,用于 hover 卡片 / tooltip) */
63
+ /** Fields not displayed in the table (can still be fetched via xObjectDataApi.fields, used for hover cards / tooltips) */
64
64
  const HIDDEN_TABLE_COLUMN_KEYS = new Set([
65
65
  'customItem244__c',
66
66
  'customItem241__c',
@@ -68,15 +68,15 @@ const HIDDEN_TABLE_COLUMN_KEYS = new Set([
68
68
  'customItem246__c',
69
69
  'customItem247__c',
70
70
  'customItem245__c',
71
- // 'objectId', // 跳转到详情页需要
72
- // 'businessTypeId' // 跳转到详情页需要
71
+ // 'objectId', // Needed for navigating to detail page
72
+ // 'businessTypeId' // Needed for navigating to detail page
73
73
  ]);
74
74
 
75
- /** 历史商机 SQL stageSwitch 一致;字段顺序需与 query fields 一致(数组行按列下标解析) */
75
+ /** Historical opportunity SQL consistent with stageSwitch; field order must match query fields (array rows parsed by column index) */
76
76
  const HISTORY_OPPORTUNITY_BI_KEY = 'biCustomModel_397169_20260401104916618';
77
77
  const HISTORY_QUERY_FIELDS = [
78
- // 'id', // 历史版本ID
79
- 'opportunity_1__id', // 商机ID
78
+ // 'id', // Historical version ID
79
+ 'opportunity_1__id', // Opportunity ID
80
80
  'opportunity_1_closeDate',
81
81
  'opportunity_1_opportunityName',
82
82
  'opportunity_1_saleStageId',
@@ -86,76 +86,76 @@ const HISTORY_QUERY_FIELDS = [
86
86
  const defaultXObjectDataApi = {
87
87
  xObjectApiKey: 'opportunity',
88
88
  fields: [
89
- 'opportunityName', // OpportunityStageName 商机名称
89
+ 'opportunityName', // OpportunityStageName Opportunity Name
90
90
  'money', // Amount
91
91
  'closeDate', // Close Date
92
92
  'customItem248__c', // Stage
93
93
  // 'oppHealthAssessmentScore',
94
94
  'recentActivityRecordTime',
95
- 'oppHealthAssessmentLevel', // 1.AI Score; hover卡片:调用商机健康度接口
96
- 'customItem239__c', // 2.AI Win Rate: hover卡片展示的3个信息,对应商机上的3个字段(baselinepositiveFactorsnegativeFactors
95
+ 'oppHealthAssessmentLevel', // 1.AI Score; hover card: calls opportunity health assessment API
96
+ 'customItem239__c', // 2.AI Win Rate: 3 fields shown in hover card (baseline, positiveFactors, negativeFactors)
97
97
  'customItem244__c', // baseline
98
98
  'customItem241__c', // positiveFactors
99
99
  'customItem242__c', // negativeFactors
100
100
  'customItem246__c', // AmoutChanged
101
101
  'customItem247__c', // ClosedDateChanged
102
102
  'customItem245__c', // StageChanged
103
- // 'objectId', // 跳转到详情页需要
104
- // 'businessTypeId' // 跳转到详情页需要
103
+ // 'objectId', // Needed for navigating to detail page
104
+ // 'businessTypeId' // Needed for navigating to detail page
105
105
  ],
106
106
  page: 1,
107
107
  pageSize: 50,
108
108
  };
109
109
  /**
110
- * 组件属性接口
110
+ * Component props interface
111
111
  */
112
112
  interface SimpleTableProps {
113
- /** XObject 实体对象的 API Key,用于标识要操作的数据对象 */
113
+ /** XObject entity API Key, used to identify the data object to operate on */
114
114
  xObjectDataApi: {
115
115
  xObjectApiKey: string;
116
116
  fields: string[];
117
117
  fieldDescList?: any[];
118
118
  autoFetchData?: boolean;
119
119
  };
120
- /** Neo 平台传递的数据,包含系统信息等 */
120
+ /** Neo platform data, including system information */
121
121
  data?: any;
122
- entityData?: any; // Neo 平台自动获取的实体数据
123
- /** 是否为自定义实体对象 */
122
+ entityData?: any; // Entity data automatically fetched by Neo platform
123
+ /** Whether it is a custom entity object */
124
124
  custom?: boolean;
125
- /** 组件类名 */
125
+ /** Component class name */
126
126
  className?: string;
127
- /** 表格标题,优先使用此配置 */
127
+ /** Table title, takes priority */
128
128
  title?: string;
129
- /** 标题下方说明文案 */
129
+ /** Description text below the title */
130
130
  description?: string;
131
- /** 当前激活的销售阶段 */
131
+ /** Currently active sales stage */
132
132
  activeStage?: string;
133
133
  }
134
134
 
135
135
  /**
136
- * 组件状态接口
136
+ * Component state interface
137
137
  */
138
138
  interface SimpleTableState {
139
- /** 表格标题 */
139
+ /** Table title */
140
140
  title?: string;
141
141
  fieldList: FieldInfo[];
142
- /** 表格数据源 */
142
+ /** Table data source */
143
143
  dataSource: any[];
144
- /** 加载状态 */
144
+ /** Loading state */
145
145
  loading: boolean;
146
- /** 错误信息 */
146
+ /** Error message */
147
147
  error: string | null;
148
- activeStage: string; // 当前激活的销售阶段
148
+ activeStage: string; // Currently active sales stage
149
149
  /**
150
- * FilterBar 事件 payload 一致(closeDateCustomRange / opportunityOwner / businessType 等);
151
- * 默认值为 defaultFiltergetFilterWhere 仅从中取值
150
+ * Consistent with FilterBar event payload (closeDateCustomRange / opportunityOwner / businessType, etc.);
151
+ * Default value is defaultFilter, getFilterWhere only reads from it
152
152
  */
153
153
  filter: any;
154
154
  }
155
155
 
156
156
  /**
157
- * XObject 数据表格组件(简化版)
158
- * 仅支持数据展示,不支持增删改查操作
157
+ * XObject data table component (simplified version)
158
+ * Supports data display only, does not support CRUD operations
159
159
  */
160
160
  export default class SimpleTable extends BaseCmp<
161
161
  SimpleTableProps,
@@ -164,7 +164,7 @@ export default class SimpleTable extends BaseCmp<
164
164
  constructor(props: SimpleTableProps) {
165
165
  super(props);
166
166
 
167
- // 初始化组件状态
167
+ // Initialize component state
168
168
  this.state = {
169
169
  fieldList: [],
170
170
  dataSource: [],
@@ -190,38 +190,38 @@ export default class SimpleTable extends BaseCmp<
190
190
  const { xObjectApiKey } = defaultXObjectDataApi;
191
191
 
192
192
  if (xObjectApiKey) {
193
- // 初始化字段列表、加载数据
193
+ // Initialize field list and load data
194
194
  this.loadFieldList();
195
195
  this.loadData();
196
196
  }
197
197
 
198
198
  /*
199
- // 广播事件:更新 FilterBar filter
199
+ // Broadcast event: update FilterBar filter
200
200
  NeoEvent.listen('updateFilterData', (filterData: any) => {
201
- console.log('SimpleTable 监听到了一个广播事件 updateFilterData: ', filterData);
201
+ console.log('SimpleTable received a broadcast event updateFilterData: ', filterData);
202
202
  this.setFilter(filterData);
203
203
  });
204
204
 
205
- // 广播事件:更新当前激活的销售阶段
205
+ // Broadcast event: update the currently active sales stage
206
206
  NeoEvent.listen('updateActiveStage', (activeStage: string) => {
207
- console.log('SimpleTable 监听到了一个广播事件 updateActiveStage: ', activeStage);
207
+ console.log('SimpleTable received a broadcast event updateActiveStage: ', activeStage);
208
208
  this.updateActiveStage(activeStage);
209
209
  });
210
210
  */
211
211
  }
212
212
 
213
213
  /**
214
- * 加载字段列表
215
- * Neo 平台获取 XObject 的字段描述信息
214
+ * Load field list
215
+ * Fetch XObject field description information from the Neo platform
216
216
  */
217
217
  async loadFieldList() {
218
218
  const xObjectDataApi: any = defaultXObjectDataApi;
219
219
 
220
- // 方式一:直接从 props.xObjectDetailApi 中获取字段描述
220
+ // Method 1: Get field descriptions directly from props.xObjectDetailApi
221
221
  if (xObjectDataApi && xObjectDataApi.fieldDescList) {
222
222
  this.setState({ fieldList: xObjectDataApi.fieldDescList });
223
223
  } else {
224
- // 方式二:自行通过 OpenAPI SDK 获取字段描述
224
+ // Method 2: Fetch field descriptions via OpenAPI SDK
225
225
  if (!xObjectDataApi.xObjectApiKey) return;
226
226
  try {
227
227
  const resultData = await xObject.getDesc(xObjectDataApi.xObjectApiKey);
@@ -231,13 +231,13 @@ export default class SimpleTable extends BaseCmp<
231
231
  this.setState({ fieldList, title: result.label });
232
232
  }
233
233
  } catch (error) {
234
- console.error('获取字段列表失败:', error);
234
+ console.error('Failed to get field list:', error);
235
235
  }
236
236
  }
237
237
  }
238
238
 
239
239
  /**
240
- * 当前表格可见字段列表(与列配置一致)
240
+ * Current visible field list for the table (consistent with column configuration)
241
241
  */
242
242
  getCurFieldList(): FieldInfo[] {
243
243
  // const { xObjectDataApi } = this.props;
@@ -256,7 +256,7 @@ export default class SimpleTable extends BaseCmp<
256
256
  }
257
257
 
258
258
  /**
259
- * 汇总用金额字段 apiKey(与金额列一致,取第一个货币字段)
259
+ * Money field apiKey for summary (consistent with the money column, takes the first currency field)
260
260
  */
261
261
  getMoneyFieldApiKey(): string | null {
262
262
  const moneyField = this.getCurFieldList().find((f) => isMoneyField(f));
@@ -264,8 +264,8 @@ export default class SimpleTable extends BaseCmp<
264
264
  }
265
265
 
266
266
  /**
267
- * 生成表格列配置
268
- * @returns 表格列配置数组
267
+ * Generate table column configuration
268
+ * @returns Array of table column configurations
269
269
  */
270
270
  generateColumns() {
271
271
  const xObjectDataApi: any = defaultXObjectDataApi;
@@ -274,7 +274,7 @@ export default class SimpleTable extends BaseCmp<
274
274
  (field) => !HIDDEN_TABLE_COLUMN_KEYS.has(field.apiKey),
275
275
  );
276
276
 
277
- // 根据字段列表生成基础列配置
277
+ // Generate base column configuration from field list
278
278
  const columns: any[] = curFieldList.map((field) => {
279
279
  const col: any = {
280
280
  title: field.label,
@@ -396,7 +396,7 @@ export default class SimpleTable extends BaseCmp<
396
396
  }
397
397
 
398
398
  /**
399
- * FilterBar 结构 filter 转为 xObject.√ where 字符串数组(与 stageSwitch 一致,SDK 按顺序 and 拼接)
399
+ * Convert FilterBar structured filter to xObject.query where string array (consistent with stageSwitch, SDK concatenates with AND in order)
400
400
  */
401
401
  getFilterWhere(): string[] {
402
402
  const raw = this.state.filter;
@@ -424,9 +424,9 @@ export default class SimpleTable extends BaseCmp<
424
424
  }
425
425
 
426
426
  /*
427
- // 如果 activeStage 存在,则添加 stage 过滤条件
427
+ // If activeStage exists, add stage filter condition
428
428
  if (this.state.activeStage) {
429
- // customItem248__c 是销售阶段字段
429
+ // customItem248__c is the sales stage field
430
430
  where.push(`customItem248__c = '${this.state.activeStage}'`);
431
431
  }
432
432
  */
@@ -434,9 +434,11 @@ export default class SimpleTable extends BaseCmp<
434
434
  return where;
435
435
  }
436
436
 
437
- /** stageSwitch一致:历史商机自定义 SQL where(opportunity_1_* 字段) */
437
+ /** Consistent with stageSwitch: historical opportunity custom SQL where (opportunity_1_* fields) */
438
438
  getHistoryOpportunityQueryFilter(): string[] {
439
439
  const raw = this.state.filter;
440
+ const defaultFilter = getDefaultFilterByProps(this.props);
441
+
440
442
  const curFilter: Record<string, unknown> =
441
443
  raw && typeof raw === 'object' && !Array.isArray(raw)
442
444
  ? Object.keys(raw as object).length > 0
@@ -472,7 +474,7 @@ export default class SimpleTable extends BaseCmp<
472
474
  return where;
473
475
  }
474
476
 
475
- /** 查询期间初历史商机列表(与 stageSwitch.fetchHistoryOpportunityList 同源,字段按需求扩展) */
477
+ /** Query historical opportunity list for the period (same source as stageSwitch.fetchHistoryOpportunityList, fields extended as needed) */
476
478
  async fetchHistoryOpportunityList(): Promise<unknown[]> {
477
479
  const result = await queryByCustomSQL({
478
480
  xObjectApiKey: HISTORY_OPPORTUNITY_BI_KEY,
@@ -486,7 +488,7 @@ export default class SimpleTable extends BaseCmp<
486
488
  }
487
489
 
488
490
  /**
489
- * 加载表格数据
491
+ * Load table data
490
492
  */
491
493
  @NeoEvent.function
492
494
  async loadData() {
@@ -519,7 +521,7 @@ export default class SimpleTable extends BaseCmp<
519
521
 
520
522
  console.log('[SimpleTable__c] records:', records, historyRows);
521
523
 
522
- // 根据阶段过滤数据
524
+ // Filter data by stage
523
525
  if (this.state.activeStage) {
524
526
  records = records.filter((record: any) => {
525
527
  return record.customItem248__c === this.state.activeStage;
@@ -543,20 +545,20 @@ export default class SimpleTable extends BaseCmp<
543
545
  });
544
546
  } else {
545
547
  this.setState({
546
- error: result?.msg || '获取数据失败',
548
+ error: result?.msg || 'Failed to fetch data',
547
549
  loading: false,
548
550
  });
549
551
  }
550
552
  } catch (error: any) {
551
553
  this.setState({
552
- error: error.message || '获取数据失败',
554
+ error: error.message || 'Failed to fetch data',
553
555
  loading: false,
554
556
  });
555
557
  }
556
558
  }
557
559
 
558
560
  /**
559
- * stageSwitch 一致:更新 FilterBar filter 并重新拉取表格数据。
561
+ * Consistent with stageSwitch: update FilterBar filter and re-fetch table data.
560
562
  */
561
563
  @NeoEvent.function
562
564
  setFilter(filter?: any) {
@@ -570,7 +572,7 @@ export default class SimpleTable extends BaseCmp<
570
572
  }
571
573
 
572
574
  /**
573
- * 更新当前激活的销售阶段
575
+ * Update the currently active sales stage
574
576
  */
575
577
  @NeoEvent.function
576
578
  updateActiveStage(activeStage?: string) {
@@ -584,8 +586,8 @@ export default class SimpleTable extends BaseCmp<
584
586
  }
585
587
 
586
588
  /**
587
- * 渲染组件
588
- * @returns 组件 JSX 元素
589
+ * Render component
590
+ * @returns Component JSX element
589
591
  */
590
592
  render() {
591
593
  const { title: stateTitle, dataSource, loading, error } = this.state;
@@ -594,8 +596,8 @@ export default class SimpleTable extends BaseCmp<
594
596
  const { xObjectApiKey } = defaultXObjectDataApi;
595
597
  const columns = this.generateColumns();
596
598
 
597
- // 优先使用 props.title,其次使用 state.title,最后使用默认值
598
- const displayTitle = propsTitle || stateTitle || '数据表格';
599
+ // Use props.title first, then state.title, and finally the default value
600
+ const displayTitle = propsTitle || stateTitle || 'Data Table';
599
601
 
600
602
  const moneyKey = this.getMoneyFieldApiKey();
601
603
  const totalAmount = moneyKey ? sumMoneyRows(dataSource, moneyKey) : 0;
@@ -613,7 +615,7 @@ export default class SimpleTable extends BaseCmp<
613
615
  );
614
616
 
615
617
  return (
616
- <div className={`simpleTable__c ${className}`} data-time="2026.4.15 01">
618
+ <div className={`simpleTable__c ${className}`} data-time="2026.4.17 01">
617
619
  <div className="table-wrapper">
618
620
  <div className="panel-header">
619
621
  <div className="panel-header-text">
@@ -634,7 +636,7 @@ export default class SimpleTable extends BaseCmp<
634
636
  </div>
635
637
  </div>
636
638
  <div className="table-container">
637
- <Spin spinning={loading} tip="加载数据中...">
639
+ <Spin spinning={loading} tip="Loading data...">
638
640
  {error ? (
639
641
  <Empty
640
642
  image={Empty.PRESENTED_IMAGE_SIMPLE}