neo-cmp-cli 1.13.12 → 1.13.13
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/dist/neo/neoService.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +1 -1
- package/template/antd-custom-cmp-template/package.json +1 -1
- package/template/asset-manage-template/package.json +1 -1
- package/template/echarts-custom-cmp-template/package.json +1 -1
- package/template/empty-custom-cmp-template/package.json +1 -1
- package/template/map-custom-cmp-template/package.json +1 -1
- package/template/neo-bi-cmps/package.json +1 -1
- package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/README.md +52 -0
- package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/index.tsx +176 -0
- package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/model.ts +49 -0
- package/template/neo-bi-cmps/src/components/aiCommitDrawer__c/style.scss +218 -0
- package/template/neo-bi-cmps/src/components/filterBar__c/README.md +35 -0
- package/template/neo-bi-cmps/src/components/filterBar__c/index.tsx +186 -0
- package/template/neo-bi-cmps/src/components/filterBar__c/model.ts +72 -0
- package/template/neo-bi-cmps/src/components/filterBar__c/style.scss +212 -0
- package/template/neo-bi-cmps/src/components/forecastChart__c/README.md +31 -0
- package/template/neo-bi-cmps/src/components/forecastChart__c/index.tsx +161 -0
- package/template/neo-bi-cmps/src/components/forecastChart__c/model.ts +39 -0
- package/template/neo-bi-cmps/src/components/forecastChart__c/style.scss +154 -0
- package/template/neo-bi-cmps/src/components/forecastGrid__c/README.md +36 -0
- package/template/neo-bi-cmps/src/components/forecastGrid__c/index.tsx +86 -0
- package/template/neo-bi-cmps/src/components/forecastGrid__c/model.ts +34 -0
- package/template/neo-bi-cmps/src/components/forecastGrid__c/style.scss +48 -0
- package/template/neo-bi-cmps/src/components/gapCloser__c/README.md +24 -0
- package/template/neo-bi-cmps/src/components/gapCloser__c/index.tsx +95 -0
- package/template/neo-bi-cmps/src/components/gapCloser__c/model.ts +43 -0
- package/template/neo-bi-cmps/src/components/gapCloser__c/style.scss +60 -0
- package/template/neo-bi-cmps/src/components/kpiCards__c/README.md +35 -0
- package/template/neo-bi-cmps/src/components/kpiCards__c/index.tsx +70 -0
- package/template/neo-bi-cmps/src/components/kpiCards__c/model.ts +35 -0
- package/template/neo-bi-cmps/src/components/kpiCards__c/style.scss +33 -0
- package/template/neo-bi-cmps/src/components/oppList__c/README.md +52 -0
- package/template/neo-bi-cmps/src/components/oppList__c/index.tsx +228 -0
- package/template/neo-bi-cmps/src/components/oppList__c/model.ts +40 -0
- package/template/neo-bi-cmps/src/components/oppList__c/style.scss +133 -0
- package/template/neo-bi-cmps/src/components/pipelineFunnel__c/README.md +39 -0
- package/template/neo-bi-cmps/src/components/pipelineFunnel__c/index.tsx +128 -0
- package/template/neo-bi-cmps/src/components/pipelineFunnel__c/model.ts +42 -0
- package/template/neo-bi-cmps/src/components/pipelineFunnel__c/style.scss +133 -0
- package/template/neo-bi-cmps/src/components/stageSwitch__c/README.md +36 -0
- package/template/neo-bi-cmps/src/components/stageSwitch__c/index.tsx +103 -0
- package/template/neo-bi-cmps/src/components/stageSwitch__c/model.ts +37 -0
- package/template/neo-bi-cmps/src/components/stageSwitch__c/style.scss +89 -0
- package/template/neo-bi-cmps/src/components/stageTimeChart__c/README.md +37 -0
- package/template/neo-bi-cmps/src/components/stageTimeChart__c/index.tsx +126 -0
- package/template/neo-bi-cmps/src/components/stageTimeChart__c/model.ts +35 -0
- package/template/neo-bi-cmps/src/components/stageTimeChart__c/style.scss +140 -0
- package/template/neo-bi-cmps/src/components/tabSwitch__c/README.md +37 -0
- package/template/neo-bi-cmps/src/components/tabSwitch__c/index.tsx +80 -0
- package/template/neo-bi-cmps/src/components/tabSwitch__c/model.ts +45 -0
- package/template/neo-bi-cmps/src/components/tabSwitch__c/style.scss +37 -0
- package/template/neo-custom-cmp-template/package.json +1 -1
- package/template/neo-h5-cmps/package.json +1 -1
- package/template/neo-order-cmps/package.json +1 -1
- package/template/neo-web-entity-grid/package.json +1 -1
- package/template/neo-web-form/package.json +1 -1
- package/template/react-custom-cmp-template/package.json +1 -1
- package/template/react-ts-custom-cmp-template/package.json +1 -1
- package/template/vue2-custom-cmp-template/package.json +1 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
.stage-time-chart__c {
|
|
2
|
+
background: #fff;
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
padding: 20px;
|
|
5
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
|
|
9
|
+
.chart-header {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
align-items: center;
|
|
13
|
+
margin-bottom: 4px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.chart-title {
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
margin: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ai-btn {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
transition: transform 0.2s;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
transform: scale(1.1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.chart-legend {
|
|
33
|
+
display: flex;
|
|
34
|
+
gap: 16px;
|
|
35
|
+
font-size: 11px;
|
|
36
|
+
color: #888;
|
|
37
|
+
margin-bottom: 16px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.legend-item {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 4px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.legend-actual {
|
|
47
|
+
display: inline-block;
|
|
48
|
+
width: 12px;
|
|
49
|
+
height: 8px;
|
|
50
|
+
background: #22c55e;
|
|
51
|
+
border-radius: 2px;
|
|
52
|
+
margin-right: 4px;
|
|
53
|
+
vertical-align: middle;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.legend-target {
|
|
57
|
+
display: inline-block;
|
|
58
|
+
width: 0;
|
|
59
|
+
height: 0;
|
|
60
|
+
border-left: 4px solid transparent;
|
|
61
|
+
border-right: 4px solid transparent;
|
|
62
|
+
border-top: 6px solid #6366f1;
|
|
63
|
+
margin-right: 4px;
|
|
64
|
+
vertical-align: middle;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.legend-limit {
|
|
68
|
+
display: inline-block;
|
|
69
|
+
width: 0;
|
|
70
|
+
height: 0;
|
|
71
|
+
border-left: 4px solid transparent;
|
|
72
|
+
border-right: 4px solid transparent;
|
|
73
|
+
border-top: 6px solid #ef4444;
|
|
74
|
+
margin-right: 4px;
|
|
75
|
+
vertical-align: middle;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.chart-body {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
gap: 24px;
|
|
82
|
+
flex: 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.stage-time-item {
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.stage-time-header {
|
|
90
|
+
display: flex;
|
|
91
|
+
justify-content: space-between;
|
|
92
|
+
font-size: 12px;
|
|
93
|
+
margin-bottom: 4px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.stage-name {
|
|
97
|
+
color: #333;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.stage-time-value {
|
|
101
|
+
font-weight: 600;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.stage-time-bar {
|
|
105
|
+
position: relative;
|
|
106
|
+
height: 28px;
|
|
107
|
+
background: #eee;
|
|
108
|
+
border-radius: 3px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.stage-time-actual {
|
|
112
|
+
height: 100%;
|
|
113
|
+
border-radius: 4px;
|
|
114
|
+
transition: width 0.3s ease;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.stage-time-target {
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: -3px;
|
|
120
|
+
width: 0;
|
|
121
|
+
height: 0;
|
|
122
|
+
border-left: 5px solid transparent;
|
|
123
|
+
border-right: 5px solid transparent;
|
|
124
|
+
border-top: 8px solid #6366f1;
|
|
125
|
+
margin-left: -5px;
|
|
126
|
+
z-index: 2;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.stage-time-limit {
|
|
130
|
+
position: absolute;
|
|
131
|
+
top: -3px;
|
|
132
|
+
width: 0;
|
|
133
|
+
height: 0;
|
|
134
|
+
border-left: 5px solid transparent;
|
|
135
|
+
border-right: 5px solid transparent;
|
|
136
|
+
border-top: 8px solid #ef4444;
|
|
137
|
+
margin-left: -5px;
|
|
138
|
+
z-index: 2;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# TabSwitch 组件
|
|
2
|
+
|
|
3
|
+
Tab切换组件,支持多个Tab页之间的切换。
|
|
4
|
+
|
|
5
|
+
## 使用方式
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import TabSwitch from './components/tabSwitch__c';
|
|
9
|
+
|
|
10
|
+
// 使用示例
|
|
11
|
+
<TabSwitch
|
|
12
|
+
tabs={[
|
|
13
|
+
{ key: 'pipeline', label: 'Pipeline' },
|
|
14
|
+
{ key: 'forecast', label: 'Forecast' },
|
|
15
|
+
]}
|
|
16
|
+
activeTab="pipeline"
|
|
17
|
+
onTabChange={(key) => console.log('切换到:', key)}
|
|
18
|
+
/>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
24
|
+
|------|------|------|--------|
|
|
25
|
+
| tabs | Tab配置数组 | TabItem[] | [] |
|
|
26
|
+
| activeTab | 当前激活的Tab | string | 第一个Tab |
|
|
27
|
+
| onTabChange | Tab切换回调 | (key: string) => void | - |
|
|
28
|
+
| className | 自定义类名 | string | - |
|
|
29
|
+
| style | 自定义样式 | React.CSSProperties | - |
|
|
30
|
+
|
|
31
|
+
## TabItem
|
|
32
|
+
|
|
33
|
+
| 属性 | 说明 | 类型 |
|
|
34
|
+
|------|------|------|
|
|
35
|
+
| key | 唯一标识 | string |
|
|
36
|
+
| label | 显示文本 | string |
|
|
37
|
+
| icon | 图标 | string |
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Tab切换组件
|
|
3
|
+
* @description 支持Pipeline/Forecast等Tab切换功能
|
|
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 TabItem {
|
|
12
|
+
key: string;
|
|
13
|
+
label: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface TabSwitchProps {
|
|
18
|
+
tabs: TabItem[];
|
|
19
|
+
activeTab?: string;
|
|
20
|
+
onTabChange?: (key: string) => void;
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface TabSwitchState {
|
|
26
|
+
activeTab: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class TabSwitch extends BaseCmp<TabSwitchProps, TabSwitchState> {
|
|
30
|
+
constructor(props: TabSwitchProps) {
|
|
31
|
+
super(props);
|
|
32
|
+
this.state = {
|
|
33
|
+
activeTab: props.activeTab || (props.tabs?.[0]?.key ?? ''),
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
this.handleTabClick = this.handleTabClick.bind(this);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
componentDidMount() {
|
|
40
|
+
console.log('TabSwitch 组件挂载');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
componentWillReceiveProps(nextProps: TabSwitchProps) {
|
|
44
|
+
if (nextProps.activeTab && nextProps.activeTab !== this.props.activeTab) {
|
|
45
|
+
this.setState({ activeTab: nextProps.activeTab });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
handleTabClick(key: string) {
|
|
50
|
+
this.setState({ activeTab: key });
|
|
51
|
+
const { onTabChange } = this.props;
|
|
52
|
+
if (onTabChange) {
|
|
53
|
+
onTabChange(key);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
render() {
|
|
58
|
+
const { tabs = [], className, style } = this.props;
|
|
59
|
+
const { activeTab } = this.state;
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<div className={`tab-switch__c ${className || ''}`} style={style}>
|
|
63
|
+
<div className="tab-bar">
|
|
64
|
+
{tabs.map((tab) => (
|
|
65
|
+
<button
|
|
66
|
+
key={tab.key}
|
|
67
|
+
className={`tab-btn ${activeTab === tab.key ? 'active' : ''}`}
|
|
68
|
+
onClick={() => this.handleTabClick(tab.key)}
|
|
69
|
+
>
|
|
70
|
+
{tab.icon && <span className="tab-icon">{tab.icon}</span>}
|
|
71
|
+
{tab.label}
|
|
72
|
+
</button>
|
|
73
|
+
))}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export default StatusHoc(TabSwitch);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export class TabSwitchModel {
|
|
2
|
+
label: string = 'Tab切换';
|
|
3
|
+
description: string = '支持Pipeline/Forecast等Tab切换功能';
|
|
4
|
+
iconUrl: string = 'https://custom-widgets.bj.bcebos.com/tabSwitch.svg';
|
|
5
|
+
targetPage: string[] = ['all'];
|
|
6
|
+
targetDevice: string = 'all';
|
|
7
|
+
|
|
8
|
+
defaultComProps = {
|
|
9
|
+
tabs: [
|
|
10
|
+
{ key: 'pipeline', label: 'Pipeline', icon: '' },
|
|
11
|
+
{ key: 'forecast', label: 'Forecast', icon: '' },
|
|
12
|
+
],
|
|
13
|
+
activeTab: 'pipeline',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
functions = [
|
|
17
|
+
{
|
|
18
|
+
apiKey: 'setActiveTab',
|
|
19
|
+
label: '设置当前Tab',
|
|
20
|
+
helpTextKey: '设置当前激活的Tab页',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
propsSchema = [
|
|
25
|
+
{
|
|
26
|
+
type: 'object',
|
|
27
|
+
name: 'tabs',
|
|
28
|
+
label: 'Tab配置',
|
|
29
|
+
schema: [
|
|
30
|
+
{
|
|
31
|
+
type: 'string',
|
|
32
|
+
name: 'tabLabel',
|
|
33
|
+
label: 'Tab标签',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: 'string',
|
|
39
|
+
name: 'activeTab',
|
|
40
|
+
label: '当前激活Tab',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default TabSwitchModel;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.tab-switch__c {
|
|
2
|
+
.tab-bar {
|
|
3
|
+
display: flex;
|
|
4
|
+
gap: 0;
|
|
5
|
+
margin-bottom: 20px;
|
|
6
|
+
border-bottom: 2px solid #e5e7eb;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.tab-btn {
|
|
10
|
+
padding: 10px 24px;
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
border: none;
|
|
15
|
+
background: none;
|
|
16
|
+
color: #999;
|
|
17
|
+
border-bottom: 2px solid transparent;
|
|
18
|
+
margin-bottom: -2px;
|
|
19
|
+
transition: all 0.2s;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: 6px;
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
color: #6366f1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.active {
|
|
29
|
+
color: #6366f1;
|
|
30
|
+
border-bottom-color: #6366f1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.tab-icon {
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|