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.
- package/README.md +23 -3
- package/dist/index2.js +1 -1
- package/dist/neo/env.js +1 -1
- package/dist/neo/pushCmp.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +3 -2
- package/template/asset-manage-template/docs/README.md +1 -232
- package/template/echarts-custom-cmp-template/package.json +1 -1
- package/template/neo-bi-cmps/package.json +1 -1
- package/template/neo-bi-cmps/src/components/filterBar__c/common.scss +1 -1
- package/template/neo-bi-cmps/src/components/filterBar__c/index.tsx +18 -10
- package/template/neo-bi-cmps/src/components/filterBar__c/model.ts +8 -2
- package/template/neo-bi-cmps/src/components/targetNumber__c/model.ts +1 -1
- package/template/neo-bi-cmps/src/utils/common.ts +18 -20
- package/template/neo-bi-cmps/src/utils/filter2chartFilter.ts +4 -6
- package/template/neo-bi-cmps/src/utils/pipelineFunnel.ts +4 -2
- package/template/neo-bi-cmps/src/utils/simpleTable.tsx +21 -16
- package/template/neo-custom-cmp-template/docs/README.md +0 -231
- package/template/neo-custom-cmp-template/package.json +1 -1
- package/template/neo-h5-cmps/src/components/entityList__c/index.tsx +1 -2
- package/template/neo-h5-cmps/src/components/entityTabs__c/index.tsx +1 -1
- package/template/neo-h5-cmps/src/components/globalSearchInput__c/index.tsx +1 -1
- package/template/neo-h5-cmps/src/components/openChatPageBtn__c/index.tsx +1 -2
- package/template/neo-pipeline-cmps/neo.config.js +11 -0
- package/template/neo-pipeline-cmps/src/assets/css/common.scss +16 -16
- package/template/neo-pipeline-cmps/src/assets/css/mixin.scss +5 -5
- package/template/neo-pipeline-cmps/src/components/filterBar__c/README.md +9 -9
- package/template/neo-pipeline-cmps/src/components/filterBar__c/common.scss +5 -5
- package/template/neo-pipeline-cmps/src/components/filterBar__c/index.tsx +47 -46
- package/template/neo-pipeline-cmps/src/components/filterBar__c/model.ts +22 -12
- package/template/neo-pipeline-cmps/src/components/filterBar__c/style.scss +1 -1
- package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/README.md +17 -17
- package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/index.tsx +24 -22
- package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/model.ts +31 -18
- package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/reset.scss +4 -0
- package/template/neo-pipeline-cmps/src/components/showHealthResult__c/index.tsx +33 -26
- package/template/neo-pipeline-cmps/src/components/showHealthResult__c/model.ts +9 -9
- package/template/neo-pipeline-cmps/src/components/simpleTable__c/README.md +53 -54
- package/template/neo-pipeline-cmps/src/components/simpleTable__c/common.scss +5 -5
- package/template/neo-pipeline-cmps/src/components/simpleTable__c/index.tsx +70 -68
- package/template/neo-pipeline-cmps/src/components/simpleTable__c/model.ts +41 -41
- package/template/neo-pipeline-cmps/src/components/simpleTable__c/style.scss +2 -3
- package/template/neo-pipeline-cmps/src/components/stageSwitch__c/README.md +15 -15
- package/template/neo-pipeline-cmps/src/components/stageSwitch__c/index.tsx +35 -33
- package/template/neo-pipeline-cmps/src/components/stageSwitch__c/model.ts +29 -16
- package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/README.md +18 -18
- package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/index.tsx +20 -20
- package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/model.ts +34 -19
- package/template/neo-pipeline-cmps/src/utils/common.ts +14 -14
- package/template/neo-pipeline-cmps/src/utils/filter2chartFilter.ts +21 -23
- package/template/neo-pipeline-cmps/src/utils/filterBar.ts +14 -14
- package/template/neo-pipeline-cmps/src/utils/pipelineFunnel.ts +5 -5
- package/template/neo-pipeline-cmps/src/utils/queryByCustomSQL.ts +26 -22
- package/template/neo-pipeline-cmps/src/utils/requestDebounce.ts +3 -3
- package/template/neo-pipeline-cmps/src/utils/simpleTable.tsx +31 -26
- package/template/neo-pipeline-cmps/src/utils/stageSwitch.ts +1 -1
- package/template/neo-pipeline-cmps/src/utils/stageTimeChart.ts +5 -5
- package/template/neo-pipeline-cmps/src/utils/targetNumber.ts +2 -2
- package/template/neo-web-entity-grid/src/components/createForm__c/index.tsx +271 -259
- package/template/neo-web-entity-grid/src/components/createForm__c/model.ts +17 -3
- package/template/neo-web-entity-grid/src/components/createForm__c/resetAntd.scss +0 -1
- package/template/neo-web-entity-grid/src/components/createForm__c/style.scss +1 -1
- package/template/neo-web-entity-grid/src/components/entityGrid2__c/index.tsx +5 -1
- package/template/neo-web-entity-grid/src/components/entityGrid2__c/model.ts +4 -3
- package/template/neo-web-entity-grid/src/components/entityGrid3__c/index.tsx +1 -1
- package/template/neo-web-entity-grid/src/components/searchForm__c/index.tsx +4 -3
- package/template/neo-web-entity-grid/src/components/searchForm__c/model.ts +9 -4
- package/template/neo-web-entity-grid/src/components/searchForm__c/style.scss +2 -1
- package/template/neo-web-form/package.json +1 -1
- package/template/neo-web-form/src/components/batchAddTable__c/index.tsx +179 -59
- package/template/neo-web-form/src/components/batchAddTable__c/model.ts +12 -14
- package/template/neo-web-form/src/components/listSummary__c/index.tsx +6 -5
- package/template/react-custom-cmp-template/package.json +1 -1
- package/template/asset-manage-template/src/utils/axiosFetcher.ts +0 -37
- package/template/asset-manage-template/src/utils/queryObjectData.ts +0 -112
- package/template/asset-manage-template/src/utils/xobjects.ts +0 -162
- package/template/neo-custom-cmp-template/src/utils/axiosFetcher.ts +0 -37
- package/template/neo-custom-cmp-template/src/utils/queryObjectData.ts +0 -112
- package/template/neo-custom-cmp-template/src/utils/xobjects.ts +0 -162
- package/template/neo-h5-cmps/src/utils/axiosFetcher.ts +0 -37
- package/template/neo-h5-cmps/src/utils/queryObjectData.ts +0 -112
- package/template/neo-h5-cmps/src/utils/xobjects.ts +0 -167
- package/template/neo-order-cmps/src/utils/axiosFetcher.ts +0 -37
- package/template/neo-order-cmps/src/utils/queryObjectData.ts +0 -112
- package/template/neo-order-cmps/src/utils/xobjects.ts +0 -162
- package/template/neo-web-entity-grid/src/utils/axiosFetcher.ts +0 -37
- package/template/neo-web-entity-grid/src/utils/queryObjectData.ts +0 -112
- package/template/neo-web-entity-grid/src/utils/xobjects.ts +0 -167
- package/template/neo-web-form/src/utils/axiosFetcher.ts +0 -37
- package/template/neo-web-form/src/utils/queryObjectData.ts +0 -112
- package/template/neo-web-form/src/utils/xobjects.ts +0 -167
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export class PipelineFunnelModel {
|
|
2
|
-
label: string = 'Pipeline
|
|
3
|
-
description: string =
|
|
2
|
+
label: string = 'Pipeline Funnel Chart';
|
|
3
|
+
description: string =
|
|
4
|
+
'Displays the funnel conversion of the sales pipeline, visually showing amount and count at each stage';
|
|
4
5
|
iconUrl: string = 'https://custom-widgets.bj.bcebos.com/funnel.svg';
|
|
5
6
|
targetPage: string[] = ['all'];
|
|
6
7
|
targetDevice: string = 'all';
|
|
@@ -10,35 +11,47 @@ export class PipelineFunnelModel {
|
|
|
10
11
|
viewId: '4264464770007375',
|
|
11
12
|
viewType: 'sync',
|
|
12
13
|
showAiButton: true,
|
|
13
|
-
/**
|
|
14
|
+
/** When true, layer width decreases with stage order (classic shape), layer height proportional to amount; default false, layer width proportional to actual amount */
|
|
14
15
|
useClassicFunnelShape: false,
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
events = [
|
|
18
19
|
{
|
|
19
20
|
apiKey: 'onActiveStageChange',
|
|
20
|
-
label: '
|
|
21
|
+
label: 'Triggered on stage click',
|
|
21
22
|
helpText:
|
|
22
|
-
'
|
|
23
|
-
eventParams:
|
|
24
|
-
|
|
23
|
+
'Triggered when clicking a funnel stage; event params include activeStage (current active stage)',
|
|
24
|
+
eventParams: [
|
|
25
|
+
{
|
|
26
|
+
apiKey: 'eventParam',
|
|
27
|
+
children: [
|
|
28
|
+
{
|
|
29
|
+
apiKey: 'activeStage',
|
|
30
|
+
label: 'Current active stage',
|
|
31
|
+
type: 'String',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
label: 'Event parameters',
|
|
35
|
+
type: 'Object',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
25
38
|
},
|
|
26
39
|
];
|
|
27
40
|
|
|
28
41
|
functions = [
|
|
29
42
|
{
|
|
30
43
|
apiKey: 'refreshData',
|
|
31
|
-
label: '
|
|
32
|
-
helpTextKey: '
|
|
44
|
+
label: 'Refresh data',
|
|
45
|
+
helpTextKey: 'Re-request queryDataTask to refresh funnel chart data',
|
|
33
46
|
},
|
|
34
47
|
{
|
|
35
48
|
apiKey: 'setFilter',
|
|
36
|
-
label: '
|
|
37
|
-
helpTextKey: '
|
|
49
|
+
label: 'Set filter conditions',
|
|
50
|
+
helpTextKey: 'Set the report component filter and re-fetch data',
|
|
38
51
|
funcInParams: [
|
|
39
52
|
{
|
|
40
53
|
apiKey: 'filter',
|
|
41
|
-
label: '
|
|
54
|
+
label: 'Filter conditions',
|
|
42
55
|
type: 'Object',
|
|
43
56
|
required: false,
|
|
44
57
|
},
|
|
@@ -50,26 +63,26 @@ export class PipelineFunnelModel {
|
|
|
50
63
|
{
|
|
51
64
|
type: 'panelInput',
|
|
52
65
|
name: 'title',
|
|
53
|
-
label: '
|
|
66
|
+
label: 'Title',
|
|
54
67
|
},
|
|
55
68
|
{
|
|
56
69
|
type: 'panelInput',
|
|
57
70
|
name: 'viewId',
|
|
58
|
-
label: '
|
|
71
|
+
label: 'View ID',
|
|
59
72
|
},
|
|
60
73
|
{
|
|
61
74
|
type: 'panelInput',
|
|
62
75
|
name: 'viewType',
|
|
63
|
-
label: '
|
|
76
|
+
label: 'View type (request type)',
|
|
64
77
|
},
|
|
65
78
|
{
|
|
66
79
|
type: 'panelSelect',
|
|
67
80
|
name: 'useClassicFunnelShape',
|
|
68
|
-
label: '
|
|
81
|
+
label: 'Funnel shape',
|
|
69
82
|
value: false,
|
|
70
83
|
options: [
|
|
71
|
-
{ label: '
|
|
72
|
-
{ label: '
|
|
84
|
+
{ label: 'Shape based on actual amount', value: false },
|
|
85
|
+
{ label: 'Classic funnel (layer height by value)', value: true },
|
|
73
86
|
],
|
|
74
87
|
clearable: false,
|
|
75
88
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file
|
|
3
|
-
* @description
|
|
2
|
+
* @file Opportunity Health Assessment Result Display
|
|
3
|
+
* @description Calls /rest/ai/v2.0/agent/apps/health_assessment/get_health_assessment_result, displays assessmentConclusion summary and ECharts radar chart based on assessmentDimension
|
|
4
4
|
*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import * as echarts from 'echarts';
|
|
@@ -17,9 +17,9 @@ const HEALTH_ASSESSMENT_URL =
|
|
|
17
17
|
export type HealthScoreRow = { name: string; score: number };
|
|
18
18
|
|
|
19
19
|
interface ShowHealthResultProps {
|
|
20
|
-
/**
|
|
20
|
+
/** Entity API Key, corresponding to request body object_api_key */
|
|
21
21
|
xObjectApiKey?: string;
|
|
22
|
-
/**
|
|
22
|
+
/** Business data ID, corresponding to request body data_id */
|
|
23
23
|
id?: string;
|
|
24
24
|
className?: string;
|
|
25
25
|
style?: React.CSSProperties;
|
|
@@ -60,12 +60,7 @@ function parseSummaryFromConclusion(conclusion: unknown): string {
|
|
|
60
60
|
.map((x: any) => {
|
|
61
61
|
if (!x || typeof x !== 'object') return '';
|
|
62
62
|
return (
|
|
63
|
-
x.summary ??
|
|
64
|
-
x.conclusion ??
|
|
65
|
-
x.desc ??
|
|
66
|
-
x.description ??
|
|
67
|
-
x.remark ??
|
|
68
|
-
''
|
|
63
|
+
x.summary ?? x.conclusion ?? x.desc ?? x.description ?? x.remark ?? ''
|
|
69
64
|
);
|
|
70
65
|
})
|
|
71
66
|
.filter((s: string) => String(s).trim());
|
|
@@ -81,10 +76,12 @@ function parseSummaryFromConclusion(conclusion: unknown): string {
|
|
|
81
76
|
}
|
|
82
77
|
|
|
83
78
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
79
|
+
* Radar chart only uses the API field assessmentDimension, which must be { name, score }[].
|
|
80
|
+
* Does not read conclusion or parse other key names (such as label / value / items wrappers).
|
|
86
81
|
*/
|
|
87
|
-
function scoreRowsFromAssessmentDimension(
|
|
82
|
+
function scoreRowsFromAssessmentDimension(
|
|
83
|
+
dimension: unknown,
|
|
84
|
+
): HealthScoreRow[] {
|
|
88
85
|
if (!Array.isArray(dimension)) return [];
|
|
89
86
|
const rows: HealthScoreRow[] = [];
|
|
90
87
|
for (const item of dimension) {
|
|
@@ -107,8 +104,8 @@ function scoreRowsFromAssessmentDimension(dimension: unknown): HealthScoreRow[]
|
|
|
107
104
|
}
|
|
108
105
|
|
|
109
106
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
107
|
+
* Radar axis outer label: no 6-character truncation; English wraps by word, non-spaced text (e.g. Chinese) wraps at fixed width.
|
|
108
|
+
* When too many lines, only the last line gets an ellipsis, other lines are shown as completely as possible.
|
|
112
109
|
*/
|
|
113
110
|
function wrapRadarAxisName(
|
|
114
111
|
text: string,
|
|
@@ -159,7 +156,9 @@ function wrapRadarAxisName(
|
|
|
159
156
|
return [...head, last].join('\n');
|
|
160
157
|
}
|
|
161
158
|
|
|
162
|
-
function buildHealthRadarOption(
|
|
159
|
+
function buildHealthRadarOption(
|
|
160
|
+
items: HealthScoreRow[],
|
|
161
|
+
): echarts.EChartsOption {
|
|
163
162
|
if (!items.length) {
|
|
164
163
|
return {
|
|
165
164
|
graphic: [
|
|
@@ -168,7 +167,7 @@ function buildHealthRadarOption(items: HealthScoreRow[]): echarts.EChartsOption
|
|
|
168
167
|
left: 'center',
|
|
169
168
|
top: 'middle',
|
|
170
169
|
style: {
|
|
171
|
-
text: '
|
|
170
|
+
text: 'No radar chart dimension data available',
|
|
172
171
|
fill: '#999',
|
|
173
172
|
fontSize: 12,
|
|
174
173
|
},
|
|
@@ -177,7 +176,7 @@ function buildHealthRadarOption(items: HealthScoreRow[]): echarts.EChartsOption
|
|
|
177
176
|
};
|
|
178
177
|
}
|
|
179
178
|
|
|
180
|
-
//
|
|
179
|
+
// Each axis has its own max to avoid low-score dimensions being squeezed; health scores are typically 0-100
|
|
181
180
|
const indicator = items.map((i) => ({
|
|
182
181
|
name: i.name,
|
|
183
182
|
max: Math.max(10, i.score, 1),
|
|
@@ -213,7 +212,7 @@ function buildHealthRadarOption(items: HealthScoreRow[]): echarts.EChartsOption
|
|
|
213
212
|
data: [
|
|
214
213
|
{
|
|
215
214
|
value: items.map((i) => i.score),
|
|
216
|
-
name: '
|
|
215
|
+
name: 'Health Score',
|
|
217
216
|
areaStyle: {
|
|
218
217
|
color: 'rgba(99,102,241,0.2)',
|
|
219
218
|
},
|
|
@@ -231,7 +230,10 @@ function buildHealthRadarOption(items: HealthScoreRow[]): echarts.EChartsOption
|
|
|
231
230
|
};
|
|
232
231
|
}
|
|
233
232
|
|
|
234
|
-
class ShowHealthResult extends BaseCmp<
|
|
233
|
+
class ShowHealthResult extends BaseCmp<
|
|
234
|
+
ShowHealthResultProps,
|
|
235
|
+
ShowHealthResultState
|
|
236
|
+
> {
|
|
235
237
|
private radarChartRef = React.createRef<HTMLDivElement>();
|
|
236
238
|
|
|
237
239
|
private radarChartInstance: echarts.ECharts | null = null;
|
|
@@ -378,11 +380,11 @@ class ShowHealthResult extends BaseCmp<ShowHealthResultProps, ShowHealthResultSt
|
|
|
378
380
|
},
|
|
379
381
|
);
|
|
380
382
|
} catch (e: any) {
|
|
381
|
-
console.error('showHealthResult
|
|
383
|
+
console.error('showHealthResult health assessment API failed:', e);
|
|
382
384
|
this.setState(
|
|
383
385
|
{
|
|
384
386
|
loading: false,
|
|
385
|
-
error: e?.message || '
|
|
387
|
+
error: e?.message || 'Request failed',
|
|
386
388
|
summaryText: '',
|
|
387
389
|
scoreRows: [],
|
|
388
390
|
},
|
|
@@ -406,13 +408,16 @@ class ShowHealthResult extends BaseCmp<ShowHealthResultProps, ShowHealthResultSt
|
|
|
406
408
|
<div
|
|
407
409
|
className={`showHealthResult__c ${className || ''}`}
|
|
408
410
|
style={style}
|
|
411
|
+
data-time="2026.4.17 01"
|
|
409
412
|
>
|
|
410
413
|
{loading && (
|
|
411
414
|
<div className="showHealthResult__c__loading" aria-busy="true">
|
|
412
415
|
<span className="showHealthResult__c__loadingDot" />
|
|
413
416
|
<span className="showHealthResult__c__loadingDot" />
|
|
414
417
|
<span className="showHealthResult__c__loadingDot" />
|
|
415
|
-
<span className="showHealthResult__c__loadingText"
|
|
418
|
+
<span className="showHealthResult__c__loadingText">
|
|
419
|
+
Fetching health assessment...
|
|
420
|
+
</span>
|
|
416
421
|
</div>
|
|
417
422
|
)}
|
|
418
423
|
|
|
@@ -423,7 +428,7 @@ class ShowHealthResult extends BaseCmp<ShowHealthResultProps, ShowHealthResultSt
|
|
|
423
428
|
>
|
|
424
429
|
<div className="showHealthResult__c__placeholderBody">
|
|
425
430
|
<div className="showHealthResult__c__placeholderTitle">
|
|
426
|
-
|
|
431
|
+
Unable to retrieve assessment results at this time
|
|
427
432
|
</div>
|
|
428
433
|
<div className="showHealthResult__c__placeholderMsg">{error}</div>
|
|
429
434
|
</div>
|
|
@@ -434,10 +439,12 @@ class ShowHealthResult extends BaseCmp<ShowHealthResultProps, ShowHealthResultSt
|
|
|
434
439
|
<div className="showHealthResult__c__placeholder showHealthResult__c__placeholder--empty">
|
|
435
440
|
<div className="showHealthResult__c__placeholderBody">
|
|
436
441
|
<div className="showHealthResult__c__placeholderTitle">
|
|
437
|
-
|
|
442
|
+
No assessment data available
|
|
438
443
|
</div>
|
|
439
444
|
<div className="showHealthResult__c__placeholderHint">
|
|
440
|
-
|
|
445
|
+
The current record may not have generated a health assessment
|
|
446
|
+
conclusion yet. Please try again later or check if the data is
|
|
447
|
+
complete.
|
|
441
448
|
</div>
|
|
442
449
|
</div>
|
|
443
450
|
</div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file
|
|
2
|
+
* @file Opportunity Health Assessment Result Display - Editor model
|
|
3
3
|
*/
|
|
4
4
|
export class ShowHealthResultModel {
|
|
5
|
-
label: string = '
|
|
5
|
+
label: string = 'Health Score Display';
|
|
6
6
|
|
|
7
7
|
description: string =
|
|
8
|
-
'
|
|
8
|
+
'Calls the health assessment API to display conclusion summary and radar chart';
|
|
9
9
|
|
|
10
10
|
iconUrl: string = 'https://custom-widgets.bj.bcebos.com/detail.svg';
|
|
11
11
|
|
|
@@ -21,8 +21,8 @@ export class ShowHealthResultModel {
|
|
|
21
21
|
functions = [
|
|
22
22
|
{
|
|
23
23
|
apiKey: 'refreshData',
|
|
24
|
-
label: '
|
|
25
|
-
helpTextKey: '
|
|
24
|
+
label: 'Refresh health data',
|
|
25
|
+
helpTextKey: 'Re-request the health assessment API',
|
|
26
26
|
},
|
|
27
27
|
];
|
|
28
28
|
|
|
@@ -30,14 +30,14 @@ export class ShowHealthResultModel {
|
|
|
30
30
|
{
|
|
31
31
|
type: 'panelInput',
|
|
32
32
|
name: 'xObjectApiKey',
|
|
33
|
-
label: '
|
|
34
|
-
placeholder: '
|
|
33
|
+
label: 'Entity key (xObjectApiKey)',
|
|
34
|
+
placeholder: 'e.g. opportunity',
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
type: 'panelInput',
|
|
38
38
|
name: 'id',
|
|
39
|
-
label: '
|
|
40
|
-
placeholder: '
|
|
39
|
+
label: 'Business data ID (data_id)',
|
|
40
|
+
placeholder: 'Business record primary key',
|
|
41
41
|
},
|
|
42
42
|
];
|
|
43
43
|
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# XObject
|
|
1
|
+
# XObject Data Table Component (Simplified)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
-
|
|
9
|
-
-
|
|
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 | '' |
|
|
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
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
//
|
|
1
|
+
// CSS variables
|
|
2
2
|
:root {
|
|
3
3
|
--background-color: #f5f6fa;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
//
|
|
6
|
+
// SASS variables
|
|
7
7
|
$background-color: #f5f6fa;
|
|
8
|
-
//
|
|
8
|
+
// Custom common styles
|
|
9
9
|
|
|
10
|
-
/* AI Win Rate
|
|
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
|
-
/*
|
|
34
|
+
/* Health score column hover: embedded showHealthResult__c */
|
|
35
35
|
.simpleTable-health-popover-trigger {
|
|
36
36
|
cursor: pointer;
|
|
37
37
|
display: inline-block;
|