neo-cmp-cli 1.13.16 → 1.13.17

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 (151) hide show
  1. package/README.md +2 -1
  2. package/dist/index2.js +1 -1
  3. package/dist/main2.js +1 -1
  4. package/dist/neo/neoLogin.js +1 -1
  5. package/dist/package.json.js +1 -1
  6. package/package.json +1 -1
  7. package/template/antd-custom-cmp-template/package.json +1 -1
  8. package/template/asset-manage-template/package.json +2 -2
  9. package/template/echarts-custom-cmp-template/package.json +1 -1
  10. package/template/empty-custom-cmp-template/package.json +2 -2
  11. package/template/map-custom-cmp-template/package.json +1 -1
  12. package/template/neo-bi-cmps/neo.config.js +7 -1
  13. package/template/neo-bi-cmps/package.json +8 -7
  14. package/template/neo-bi-cmps/public/403.html +77 -0
  15. package/template/neo-bi-cmps/public/demo.html +2453 -0
  16. package/template/neo-bi-cmps/src/assets/icon/barChart.svg +1 -0
  17. package/template/neo-bi-cmps/src/assets/icon/card.svg +1 -0
  18. package/template/neo-bi-cmps/src/assets/icon/filter.svg +1 -0
  19. package/template/neo-bi-cmps/src/assets/icon/funnel.svg +1 -0
  20. package/template/neo-bi-cmps/src/assets/icon/tab.svg +1 -0
  21. package/template/neo-bi-cmps/src/components/filterBar__c/README.md +3 -14
  22. package/template/neo-bi-cmps/src/components/filterBar__c/common.scss +29 -0
  23. package/template/neo-bi-cmps/src/components/filterBar__c/index.tsx +668 -146
  24. package/template/neo-bi-cmps/src/components/filterBar__c/model.ts +26 -48
  25. package/template/neo-bi-cmps/src/components/filterBar__c/style.scss +46 -139
  26. package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/index.tsx +11 -10
  27. package/template/neo-bi-cmps/src/components/targetNumber__c/index.tsx +9 -16
  28. package/template/neo-bi-cmps/src/utils/common.ts +231 -0
  29. package/template/neo-bi-cmps/src/utils/filter2chartFilter.ts +268 -0
  30. package/template/neo-bi-cmps/src/utils/filterBar.ts +140 -0
  31. package/template/neo-bi-cmps/src/utils/pipelineFunnel.ts +341 -0
  32. package/template/neo-bi-cmps/src/utils/queryByCustomSQL.ts +117 -0
  33. package/template/neo-bi-cmps/src/utils/requestDebounce.ts +22 -0
  34. package/template/neo-bi-cmps/src/utils/simpleTable.tsx +344 -0
  35. package/template/neo-bi-cmps/src/utils/stageSwitch.ts +15 -0
  36. package/template/neo-bi-cmps/src/utils/stageTimeChart.ts +90 -0
  37. package/template/neo-bi-cmps/src/utils/targetNumber.ts +12 -0
  38. package/template/neo-custom-cmp-template/package.json +2 -2
  39. package/template/neo-h5-cmps/package.json +2 -2
  40. package/template/neo-order-cmps/package.json +2 -2
  41. package/template/neo-pipeline-cmps/.prettierrc.js +12 -0
  42. package/template/neo-pipeline-cmps/@types/neo-ui-common.d.ts +36 -0
  43. package/template/neo-pipeline-cmps/README.md +99 -0
  44. package/template/neo-pipeline-cmps/commitlint.config.js +59 -0
  45. package/template/neo-pipeline-cmps/neo.config.js +124 -0
  46. package/template/neo-pipeline-cmps/package.json +66 -0
  47. package/template/neo-pipeline-cmps/public/403.html +77 -0
  48. package/template/neo-pipeline-cmps/public/css/base.css +283 -0
  49. package/template/neo-pipeline-cmps/public/demo.html +2453 -0
  50. package/template/neo-pipeline-cmps/public/scripts/app/bluebird.js +6679 -0
  51. package/template/neo-pipeline-cmps/public/template.html +13 -0
  52. package/template/neo-pipeline-cmps/src/assets/css/common.scss +127 -0
  53. package/template/neo-pipeline-cmps/src/assets/css/mixin.scss +47 -0
  54. package/template/neo-pipeline-cmps/src/assets/icon/barChart.svg +1 -0
  55. package/template/neo-pipeline-cmps/src/assets/icon/card.svg +1 -0
  56. package/template/neo-pipeline-cmps/src/assets/icon/filter.svg +1 -0
  57. package/template/neo-pipeline-cmps/src/assets/icon/funnel.svg +1 -0
  58. package/template/neo-pipeline-cmps/src/assets/icon/tab.svg +1 -0
  59. package/template/neo-pipeline-cmps/src/assets/img/AIBtn.gif +0 -0
  60. package/template/neo-pipeline-cmps/src/assets/img/NeoCRM.jpg +0 -0
  61. package/template/neo-pipeline-cmps/src/assets/img/aiLogo.png +0 -0
  62. package/template/neo-pipeline-cmps/src/assets/img/card-list.svg +1 -0
  63. package/template/neo-pipeline-cmps/src/assets/img/contact-form.svg +1 -0
  64. package/template/neo-pipeline-cmps/src/assets/img/custom-form.svg +1 -0
  65. package/template/neo-pipeline-cmps/src/assets/img/custom-widget.svg +1 -0
  66. package/template/neo-pipeline-cmps/src/assets/img/data-list.svg +1 -0
  67. package/template/neo-pipeline-cmps/src/assets/img/detail.svg +1 -0
  68. package/template/neo-pipeline-cmps/src/assets/img/favicon.png +0 -0
  69. package/template/neo-pipeline-cmps/src/assets/img/map.svg +1 -0
  70. package/template/neo-pipeline-cmps/src/assets/img/search.svg +1 -0
  71. package/template/neo-pipeline-cmps/src/assets/img/table.svg +1 -0
  72. package/template/neo-pipeline-cmps/src/components/filterBar__c/README.md +24 -0
  73. package/template/neo-pipeline-cmps/src/components/filterBar__c/common.scss +29 -0
  74. package/template/neo-pipeline-cmps/src/components/filterBar__c/index.tsx +730 -0
  75. package/template/neo-pipeline-cmps/src/components/filterBar__c/model.ts +50 -0
  76. package/template/neo-pipeline-cmps/src/components/filterBar__c/style.scss +119 -0
  77. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/index.tsx +415 -0
  78. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/model.ts +79 -0
  79. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/style.scss +83 -0
  80. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/index.tsx +463 -0
  81. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/model.ts +45 -0
  82. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/style.scss +137 -0
  83. package/template/neo-pipeline-cmps/src/components/simpleTable__c/README.md +90 -0
  84. package/template/neo-pipeline-cmps/src/components/simpleTable__c/common.scss +195 -0
  85. package/template/neo-pipeline-cmps/src/components/simpleTable__c/index.tsx +665 -0
  86. package/template/neo-pipeline-cmps/src/components/simpleTable__c/model.ts +124 -0
  87. package/template/neo-pipeline-cmps/src/components/simpleTable__c/style.scss +193 -0
  88. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/index.tsx +511 -0
  89. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/model.ts +70 -0
  90. package/template/{neo-bi-cmps → neo-pipeline-cmps}/src/components/stageSwitch__c/style.scss +4 -2
  91. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/index.tsx +455 -0
  92. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/model.ts +103 -0
  93. package/template/{neo-bi-cmps → neo-pipeline-cmps}/src/components/stageTimeChart__c/style.scss +3 -2
  94. package/template/neo-pipeline-cmps/src/utils/common.ts +229 -0
  95. package/template/neo-pipeline-cmps/src/utils/filter2chartFilter.ts +268 -0
  96. package/template/neo-pipeline-cmps/src/utils/filterBar.ts +140 -0
  97. package/template/neo-pipeline-cmps/src/utils/pipelineFunnel.ts +343 -0
  98. package/template/neo-pipeline-cmps/src/utils/queryByCustomSQL.ts +117 -0
  99. package/template/neo-pipeline-cmps/src/utils/requestDebounce.ts +22 -0
  100. package/template/neo-pipeline-cmps/src/utils/simpleTable.tsx +344 -0
  101. package/template/neo-pipeline-cmps/src/utils/stageSwitch.ts +15 -0
  102. package/template/neo-pipeline-cmps/src/utils/stageTimeChart.ts +90 -0
  103. package/template/neo-pipeline-cmps/src/utils/targetNumber.ts +12 -0
  104. package/template/neo-pipeline-cmps/tsconfig.json +40 -0
  105. package/template/neo-web-entity-grid/package.json +2 -2
  106. package/template/neo-web-form/package.json +2 -2
  107. package/template/react-custom-cmp-template/package.json +1 -1
  108. package/template/react-ts-custom-cmp-template/package.json +1 -1
  109. package/template/vue2-custom-cmp-template/package.json +1 -1
  110. package/template/neo-bi-cmps/.npmrc copy +0 -1
  111. package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/README.md +0 -52
  112. package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/index.tsx +0 -183
  113. package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/model.ts +0 -90
  114. package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/style.scss +0 -218
  115. package/template/neo-bi-cmps/src/components/forecastChart__c/README.md +0 -31
  116. package/template/neo-bi-cmps/src/components/forecastChart__c/index.tsx +0 -158
  117. package/template/neo-bi-cmps/src/components/forecastChart__c/model.ts +0 -40
  118. package/template/neo-bi-cmps/src/components/forecastChart__c/style.scss +0 -154
  119. package/template/neo-bi-cmps/src/components/forecastGrid__c/README.md +0 -36
  120. package/template/neo-bi-cmps/src/components/forecastGrid__c/index.tsx +0 -86
  121. package/template/neo-bi-cmps/src/components/forecastGrid__c/model.ts +0 -62
  122. package/template/neo-bi-cmps/src/components/forecastGrid__c/style.scss +0 -48
  123. package/template/neo-bi-cmps/src/components/gapCloser__c/README.md +0 -24
  124. package/template/neo-bi-cmps/src/components/gapCloser__c/index.tsx +0 -100
  125. package/template/neo-bi-cmps/src/components/gapCloser__c/model.ts +0 -46
  126. package/template/neo-bi-cmps/src/components/gapCloser__c/style.scss +0 -60
  127. package/template/neo-bi-cmps/src/components/kpiCards__c/README.md +0 -35
  128. package/template/neo-bi-cmps/src/components/kpiCards__c/index.tsx +0 -70
  129. package/template/neo-bi-cmps/src/components/kpiCards__c/model.ts +0 -50
  130. package/template/neo-bi-cmps/src/components/kpiCards__c/style.scss +0 -33
  131. package/template/neo-bi-cmps/src/components/oppList__c/README.md +0 -52
  132. package/template/neo-bi-cmps/src/components/oppList__c/index.tsx +0 -285
  133. package/template/neo-bi-cmps/src/components/oppList__c/model.ts +0 -86
  134. package/template/neo-bi-cmps/src/components/oppList__c/style.scss +0 -133
  135. package/template/neo-bi-cmps/src/components/pipelineFunnel__c/index.tsx +0 -130
  136. package/template/neo-bi-cmps/src/components/pipelineFunnel__c/model.ts +0 -66
  137. package/template/neo-bi-cmps/src/components/pipelineFunnel__c/style.scss +0 -133
  138. package/template/neo-bi-cmps/src/components/stageSwitch__c/index.tsx +0 -118
  139. package/template/neo-bi-cmps/src/components/stageSwitch__c/model.ts +0 -92
  140. package/template/neo-bi-cmps/src/components/stageTimeChart__c/index.tsx +0 -126
  141. package/template/neo-bi-cmps/src/components/stageTimeChart__c/model.ts +0 -57
  142. package/template/neo-bi-cmps/src/components/tabSwitch__c/README.md +0 -37
  143. package/template/neo-bi-cmps/src/components/tabSwitch__c/index.tsx +0 -80
  144. package/template/neo-bi-cmps/src/components/tabSwitch__c/model.ts +0 -45
  145. package/template/neo-bi-cmps/src/components/tabSwitch__c/style.scss +0 -37
  146. package/template/neo-bi-cmps/src/utils/axiosFetcher.ts +0 -37
  147. package/template/neo-bi-cmps/src/utils/queryObjectData.ts +0 -76
  148. package/template/neo-bi-cmps/src/utils/xobjects.ts +0 -162
  149. /package/template/{neo-bi-cmps → neo-pipeline-cmps}/src/components/pipelineFunnel__c/README.md +0 -0
  150. /package/template/{neo-bi-cmps → neo-pipeline-cmps}/src/components/stageSwitch__c/README.md +0 -0
  151. /package/template/{neo-bi-cmps → neo-pipeline-cmps}/src/components/stageTimeChart__c/README.md +0 -0
@@ -1,130 +0,0 @@
1
- /**
2
- * @file Pipeline漏斗图组件
3
- * @description 展示销售管道的漏斗转化情况
4
- */
5
- import * as React from 'react';
6
- // @ts-ignore
7
- import { BaseCmp, StatusHoc, NeoEvent } from 'neo-ui-common';
8
-
9
- import './style.scss';
10
-
11
- interface FunnelStage {
12
- name: string;
13
- amount: string;
14
- count: number;
15
- conversionRate?: string;
16
- color: string;
17
- }
18
-
19
- interface PipelineFunnelProps {
20
- title?: string;
21
- totalAmount?: string;
22
- stages?: FunnelStage[];
23
- showAiButton?: boolean;
24
- onStageClick?: (stageName: string) => void;
25
- className?: string;
26
- style?: React.CSSProperties;
27
- }
28
-
29
- interface PipelineFunnelState {
30
- loading: boolean;
31
- }
32
-
33
- class PipelineFunnel extends BaseCmp<PipelineFunnelProps, PipelineFunnelState> {
34
- constructor(props: PipelineFunnelProps) {
35
- super(props);
36
- this.state = {
37
- loading: false,
38
- };
39
- }
40
-
41
- componentDidMount() {
42
- console.log('PipelineFunnel 组件挂载');
43
- }
44
-
45
- getFunnelClipPath = (index: number, total: number): string => {
46
- const offset = index * 10;
47
- return `polygon(${offset}% 0%, ${100 - offset}% 0%, ${
48
- 100 - offset - 10
49
- }% 100%, ${offset + 10}% 100%)`;
50
- };
51
-
52
- render() {
53
- const {
54
- title = 'Pipeline Funnel',
55
- totalAmount = '$11.1M',
56
- stages = [],
57
- showAiButton = true,
58
- onStageClick,
59
- className,
60
- style,
61
- } = this.props;
62
-
63
- return (
64
- <div className={`pipeline-funnel__c ${className || ''}`} style={style}>
65
- <div className="funnel-header">
66
- <h3 className="funnel-title">{title}</h3>
67
- {showAiButton && (
68
- <span
69
- className="ai-btn"
70
- onClick={() => console.log('AI Analysis clicked')}
71
- title="AI Analysis"
72
- >
73
-
74
- </span>
75
- )}
76
- </div>
77
-
78
- <div className="funnel-total">
79
- <div className="funnel-total-label">Sales Amount</div>
80
- <div className="funnel-total-value">{totalAmount}</div>
81
- </div>
82
-
83
- <div className="funnel-body">
84
- <div className="funnel-left-rates">
85
- {stages.slice(0, -1).map((stage, index) => (
86
- <div key={index} className="funnel-rate">
87
- {stage.conversionRate || '—'}
88
- </div>
89
- ))}
90
- </div>
91
-
92
- <div className="funnel-main">
93
- {stages.map((stage, index) => (
94
- <div
95
- key={index}
96
- className="funnel-segment"
97
- style={{ backgroundColor: stage.color }}
98
- onClick={() => onStageClick?.(stage.name)}
99
- >
100
- {stage.name}
101
- </div>
102
- ))}
103
- </div>
104
-
105
- <div className="funnel-right-data">
106
- {stages.map((stage, index) => (
107
- <div key={index} className="funnel-data">
108
- {stage.amount} / {stage.count}
109
- </div>
110
- ))}
111
- </div>
112
- </div>
113
-
114
- <div className="funnel-legend">
115
- {stages.map((stage, index) => (
116
- <span key={index} className="legend-item">
117
- <span
118
- className="legend-dot"
119
- style={{ backgroundColor: stage.color }}
120
- />
121
- {stage.name}
122
- </span>
123
- ))}
124
- </div>
125
- </div>
126
- );
127
- }
128
- }
129
-
130
- export default StatusHoc(PipelineFunnel);
@@ -1,66 +0,0 @@
1
- export class PipelineFunnelModel {
2
- label: string = 'Pipeline漏斗图';
3
- description: string = '展示销售管道的漏斗转化情况,直观显示各阶段金额和数量';
4
- iconUrl: string = 'https://custom-widgets.bj.bcebos.com/pipelineFunnel.svg';
5
- targetPage: string[] = ['all'];
6
- targetDevice: string = 'all';
7
-
8
- defaultComProps = {
9
- title: 'Pipeline Funnel',
10
- totalAmount: '$11.1M',
11
- stages: [
12
- {
13
- name: 'Prospecting',
14
- amount: '$3.2M',
15
- count: 15,
16
- conversionRate: '—',
17
- color: '#3b82f6',
18
- },
19
- {
20
- name: 'Needs Analysis',
21
- amount: '$1.8M',
22
- count: 7,
23
- conversionRate: '56.3%',
24
- color: '#22c55e',
25
- },
26
- {
27
- name: 'Proposal/Price Quote',
28
- amount: '$4.5M',
29
- count: 8,
30
- conversionRate: '28.1%',
31
- color: '#f59e0b',
32
- },
33
- {
34
- name: 'Closed Won',
35
- amount: '$1.6M',
36
- count: 3,
37
- conversionRate: '10.0%',
38
- color: '#8b5cf6',
39
- },
40
- ],
41
- showAiButton: true,
42
- };
43
-
44
- functions = [
45
- {
46
- apiKey: 'refreshData',
47
- label: '刷新数据',
48
- helpTextKey: '刷新漏斗图数据',
49
- },
50
- ];
51
-
52
- propsSchema = [
53
- {
54
- type: 'string',
55
- name: 'title',
56
- label: '标题',
57
- },
58
- {
59
- type: 'string',
60
- name: 'totalAmount',
61
- label: '总金额',
62
- },
63
- ];
64
- }
65
-
66
- export default PipelineFunnelModel;
@@ -1,133 +0,0 @@
1
- .pipeline-funnel__c {
2
- background: #fff;
3
- border-radius: 8px;
4
- padding: 20px;
5
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
6
-
7
- .funnel-header {
8
- display: flex;
9
- justify-content: space-between;
10
- align-items: center;
11
- margin-bottom: 16px;
12
- }
13
-
14
- .funnel-title {
15
- font-size: 14px;
16
- font-weight: 600;
17
- margin: 0;
18
- }
19
-
20
- .ai-btn {
21
- cursor: pointer;
22
- font-size: 16px;
23
- transition: transform 0.2s;
24
-
25
- &:hover {
26
- transform: scale(1.1);
27
- }
28
- }
29
-
30
- .funnel-total {
31
- text-align: center;
32
- margin-bottom: 16px;
33
-
34
- .funnel-total-label {
35
- font-size: 12px;
36
- color: #888;
37
- }
38
-
39
- .funnel-total-value {
40
- font-size: 22px;
41
- font-weight: 700;
42
- }
43
- }
44
-
45
- .funnel-body {
46
- display: flex;
47
- align-items: stretch;
48
- gap: 0;
49
- }
50
-
51
- .funnel-left-rates {
52
- width: 100px;
53
- display: flex;
54
- flex-direction: column;
55
- justify-content: center;
56
- gap: 0;
57
- font-size: 11px;
58
- color: #888;
59
- }
60
-
61
- .funnel-rate {
62
- height: 48px;
63
- display: flex;
64
- align-items: center;
65
- }
66
-
67
- .funnel-main {
68
- flex: 1;
69
- display: flex;
70
- flex-direction: column;
71
- align-items: center;
72
- }
73
-
74
- .funnel-segment {
75
- width: 100%;
76
- height: 48px;
77
- display: flex;
78
- align-items: center;
79
- justify-content: center;
80
- color: #fff;
81
- font-size: 12px;
82
- font-weight: 600;
83
- cursor: pointer;
84
- transition: opacity 0.2s;
85
-
86
- &:hover {
87
- opacity: 0.85;
88
- }
89
- }
90
-
91
- .funnel-right-data {
92
- width: 110px;
93
- display: flex;
94
- flex-direction: column;
95
- justify-content: center;
96
- gap: 0;
97
- font-size: 11px;
98
- color: #555;
99
- text-align: right;
100
- }
101
-
102
- .funnel-data {
103
- height: 48px;
104
- display: flex;
105
- align-items: center;
106
- justify-content: flex-end;
107
- }
108
-
109
- .funnel-legend {
110
- display: flex;
111
- gap: 12px;
112
- justify-content: center;
113
- flex-wrap: wrap;
114
- margin-top: 16px;
115
- font-size: 11px;
116
- color: #666;
117
- }
118
-
119
- .legend-item {
120
- display: flex;
121
- align-items: center;
122
- gap: 4px;
123
- }
124
-
125
- .legend-dot {
126
- display: inline-block;
127
- width: 10px;
128
- height: 10px;
129
- border-radius: 50%;
130
- margin-right: 4px;
131
- vertical-align: middle;
132
- }
133
- }
@@ -1,118 +0,0 @@
1
- /**
2
- * @file 阶段切换卡片组件
3
- * @description 切换显示不同销售阶段的数据
4
- */
5
- import * as React from 'react';
6
- // @ts-ignore
7
- import { BaseCmp, StatusHoc, NeoEvent } from 'neo-ui-common';
8
-
9
- import './style.scss';
10
-
11
- interface StageTab {
12
- key: string;
13
- name: string;
14
- amount: string;
15
- count: number;
16
- changes?: {
17
- amount: string;
18
- amountDirection: 'up' | 'down';
19
- count: string;
20
- countDirection: 'up' | 'down';
21
- };
22
- }
23
-
24
- interface StageSwitchProps {
25
- stages?: StageTab[];
26
- activeStage?: string;
27
- onStageChange?: (stage: StageTab) => void;
28
- className?: string;
29
- style?: React.CSSProperties;
30
- }
31
-
32
- interface StageSwitchState {
33
- activeStage: string;
34
- }
35
-
36
- class StageSwitch extends BaseCmp<StageSwitchProps, StageSwitchState> {
37
- constructor(props: StageSwitchProps) {
38
- super(props);
39
- this.state = {
40
- activeStage: props.activeStage || (props.stages?.[0]?.key ?? ''),
41
- };
42
- }
43
-
44
- componentDidMount() {
45
- console.log('StageSwitch 组件挂载');
46
- }
47
-
48
- componentWillReceiveProps(nextProps: StageSwitchProps) {
49
- if (
50
- nextProps.activeStage &&
51
- nextProps.activeStage !== this.props.activeStage
52
- ) {
53
- this.setState({ activeStage: nextProps.activeStage });
54
- }
55
- }
56
-
57
- handleStageClick(stage: StageTab) {
58
- this.setState({ activeStage: stage.key });
59
- const { onStageChange } = this.props;
60
- if (onStageChange) {
61
- onStageChange(stage);
62
- }
63
- }
64
-
65
- render() {
66
- const { stages = [], className, style } = this.props;
67
- const { activeStage } = this.state;
68
-
69
- return (
70
- <div className={`stage-switch__c ${className || ''}`} style={style}>
71
- <div className="stage-tabs">
72
- {stages.map((stage) => (
73
- <div
74
- key={stage.key}
75
- className={`stage-tab ${
76
- activeStage === stage.key ? 'active' : ''
77
- }`}
78
- onClick={() => this.handleStageClick(stage)}
79
- >
80
- <div className="stage-name">{stage.name}</div>
81
- <div className="stage-amount-row">
82
- <span className="stage-amount">{stage.amount}</span>
83
- <span className="stage-count">({stage.count})</span>
84
- </div>
85
- {stage.changes && (
86
- <div className="stage-sub">
87
- <span
88
- className={`change-amount ${
89
- stage.changes.amountDirection === 'up'
90
- ? 'positive'
91
- : 'negative'
92
- }`}
93
- >
94
- {stage.changes.amountDirection === 'up' ? '↑' : '↓'}{' '}
95
- {stage.changes.amount}
96
- </span>
97
- <span> &nbsp; </span>
98
- <span
99
- className={`change-count ${
100
- stage.changes.countDirection === 'up'
101
- ? 'positive'
102
- : 'negative'
103
- }`}
104
- >
105
- {stage.changes.countDirection === 'up' ? '↑' : '↓'}{' '}
106
- {stage.changes.count}
107
- </span>
108
- </div>
109
- )}
110
- </div>
111
- ))}
112
- </div>
113
- </div>
114
- );
115
- }
116
- }
117
-
118
- export default StatusHoc(StageSwitch);
@@ -1,92 +0,0 @@
1
- export class StageSwitchModel {
2
- label: string = '阶段切换卡片';
3
- description: string = '切换显示不同销售阶段的数据,包含金额、数量和变化趋势';
4
- iconUrl: string = 'https://custom-widgets.bj.bcebos.com/stageSwitch.svg';
5
- targetPage: string[] = ['all'];
6
- targetDevice: string = 'all';
7
-
8
- defaultComProps = {
9
- stages: [
10
- {
11
- key: 'Prospecting',
12
- name: 'Prospecting',
13
- amount: '$3.2M',
14
- count: 15,
15
- changes: {
16
- amount: '$280K',
17
- amountDirection: 'up',
18
- count: '3',
19
- countDirection: 'up',
20
- },
21
- },
22
- {
23
- key: 'Needs Analysis',
24
- name: 'Needs Analysis',
25
- amount: '$1.8M',
26
- count: 7,
27
- changes: {
28
- amount: '$320K',
29
- amountDirection: 'down',
30
- count: '2',
31
- countDirection: 'down',
32
- },
33
- },
34
- {
35
- key: 'Proposal',
36
- name: 'Proposal/Price Quote',
37
- amount: '$4.5M',
38
- count: 8,
39
- changes: {
40
- amount: '$500K',
41
- amountDirection: 'up',
42
- count: '3',
43
- countDirection: 'up',
44
- },
45
- },
46
- {
47
- key: 'Closed Won',
48
- name: 'Closed Won',
49
- amount: '$1.6M',
50
- count: 3,
51
- changes: {
52
- amount: '$400K',
53
- amountDirection: 'up',
54
- count: '1',
55
- countDirection: 'up',
56
- },
57
- },
58
- {
59
- key: 'Closed Lost',
60
- name: 'Closed Lost',
61
- amount: '$0.9M',
62
- count: 4,
63
- changes: {
64
- amount: '$200K',
65
- amountDirection: 'down',
66
- count: '2',
67
- countDirection: 'up',
68
- },
69
- },
70
- ],
71
- activeStage: 'Prospecting',
72
- };
73
-
74
- functions = [
75
- {
76
- apiKey: 'setActiveStage',
77
- label: '设置当前阶段',
78
- helpTextKey: '设置当前激活的销售阶段',
79
- },
80
- ];
81
-
82
- propsSchema = [
83
- {
84
- type: 'object',
85
- name: 'stages',
86
- label: '阶段配置',
87
- schema: [],
88
- },
89
- ];
90
- }
91
-
92
- export default StageSwitchModel;
@@ -1,126 +0,0 @@
1
- /**
2
- * @file 阶段停留时间组件
3
- * @description 展示各销售阶段的平均停留时间,包含实际值、目标值和限制值
4
- */
5
- import * as React from 'react';
6
- // @ts-ignore
7
- import { BaseCmp, StatusHoc, NeoEvent } from 'neo-ui-common';
8
-
9
- import './style.scss';
10
-
11
- interface StageTimeItem {
12
- stageName: string;
13
- actualTime: string;
14
- actualPercent: number;
15
- actualColor: string;
16
- targetPercent: number;
17
- limitPercent: number;
18
- }
19
-
20
- interface StageTimeChartProps {
21
- title?: string;
22
- items?: StageTimeItem[];
23
- showAiButton?: boolean;
24
- onStageClick?: (stageName: string) => void;
25
- className?: string;
26
- style?: React.CSSProperties;
27
- }
28
-
29
- interface StageTimeChartState {
30
- loading: boolean;
31
- }
32
-
33
- class StageTimeChart extends BaseCmp<StageTimeChartProps, StageTimeChartState> {
34
- constructor(props: StageTimeChartProps) {
35
- super(props);
36
- this.state = {
37
- loading: false,
38
- };
39
- }
40
-
41
- componentDidMount() {
42
- console.log('StageTimeChart 组件挂载');
43
- }
44
-
45
- render() {
46
- const {
47
- title = 'Avg. Time in Stage',
48
- items = [],
49
- showAiButton = true,
50
- onStageClick,
51
- className,
52
- style,
53
- } = this.props;
54
-
55
- return (
56
- <div className={`stage-time-chart__c ${className || ''}`} style={style}>
57
- <div className="chart-header">
58
- <h3 className="chart-title">{title}</h3>
59
- {showAiButton && (
60
- <span
61
- className="ai-btn"
62
- onClick={() => console.log('AI Analysis clicked')}
63
- title="AI Analysis"
64
- >
65
-
66
- </span>
67
- )}
68
- </div>
69
-
70
- <div className="chart-legend">
71
- <span className="legend-item">
72
- <span className="legend-actual" />
73
- Actual
74
- </span>
75
- <span className="legend-item">
76
- <span className="legend-target" />
77
- Target
78
- </span>
79
- <span className="legend-item">
80
- <span className="legend-limit" />
81
- Limit
82
- </span>
83
- </div>
84
-
85
- <div className="chart-body">
86
- {items.map((item, index) => (
87
- <div
88
- key={index}
89
- className="stage-time-item"
90
- onClick={() => onStageClick?.(item.stageName)}
91
- >
92
- <div className="stage-time-header">
93
- <span className="stage-name">{item.stageName}</span>
94
- <span
95
- className="stage-time-value"
96
- style={{ color: item.actualColor }}
97
- >
98
- {item.actualTime}
99
- </span>
100
- </div>
101
- <div className="stage-time-bar">
102
- <div
103
- className="stage-time-actual"
104
- style={{
105
- width: `${item.actualPercent}%`,
106
- backgroundColor: item.actualColor,
107
- }}
108
- />
109
- <div
110
- className="stage-time-target"
111
- style={{ left: `${item.targetPercent}%` }}
112
- />
113
- <div
114
- className="stage-time-limit"
115
- style={{ left: `${item.limitPercent}%` }}
116
- />
117
- </div>
118
- </div>
119
- ))}
120
- </div>
121
- </div>
122
- );
123
- }
124
- }
125
-
126
- export default StatusHoc(StageTimeChart);