win-chart 1.0.0 → 1.0.2
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/.vscode/settings.json +166 -0
- package/build/index.html +1 -0
- package/build/js/index.js +1 -0
- package/build/report-web.html +39 -0
- package/package.json +3 -1
- package/rsbuild.config.ts +5 -0
- package/tsconfig.json +1 -0
- package/src/api/README.md +0 -15
- package/src/api/index.js +0 -5
- package/src/api/layout/index.js +0 -32
- package/src/api/request.ts +0 -87
- package/src/api/url-map/index.js +0 -10
- package/src/api/user/index.js +0 -12
- package/src/components/FilterContext.tsx +0 -6
- package/src/components/GlobalStyle.tsx +0 -25
- package/src/components/HalfScreenBrowser.tsx +0 -95
- package/src/components/ImgBox.tsx +0 -19
- package/src/components/JumpBtn.tsx +0 -38
- package/src/components/MCardWrapper.tsx +0 -33
- package/src/components/NoContent/index.tsx +0 -85
- package/src/components/ResponsiveReactGridLayout.tsx +0 -218
- package/src/components/SliderDecoration.tsx +0 -27
- package/src/components/VisionUserConfigContext.ts +0 -6
- package/src/components/WinMenu/README.md +0 -11
- package/src/components/WinMenu/WinHeader.tsx +0 -5
- package/src/components/WinMenu/components/ExtraBox.tsx +0 -61
- package/src/components/WinMenu/components/FullMenuBox.tsx +0 -80
- package/src/components/WinMenu/components/FullMenuContainer.tsx +0 -50
- package/src/components/WinMenu/components/FullMenuItem.tsx +0 -128
- package/src/components/WinMenu/components/LangSwitch.tsx +0 -84
- package/src/components/WinMenu/components/LogoBox.tsx +0 -29
- package/src/components/WinMenu/components/PinDialog.tsx +0 -72
- package/src/components/WinMenu/components/PinnedMenuBox.tsx +0 -183
- package/src/components/WinMenu/components/UserBox.tsx +0 -83
- package/src/components/WinMenu/hooks/useUserInfo.ts +0 -21
- package/src/components/WinMenu/hooks/useUserMenu.ts +0 -35
- package/src/components/WinMenu/index.tsx +0 -100
- package/src/components/WinMenu/services/WinService.ts +0 -79
- package/src/components/WinMenu/services/request.ts +0 -53
- package/src/components/WinMenu/utils/const.ts +0 -80
- package/src/components/WinMenu/utils/enum.ts +0 -19
- package/src/components/WinMenu/utils/interface.ts +0 -61
- package/src/components/WinMenu/utils/map.ts +0 -39
- package/src/components/WinMenu/utils/tool.ts +0 -142
- package/src/components/WinMenu/utils/type.ts +0 -1
- package/src/components/hover-view.tsx +0 -48
- package/src/components/icon.tsx +0 -44
- package/src/components/indicator-remark.tsx +0 -25
- package/src/components/none-content.tsx +0 -93
- package/src/components/panel-tab.tsx +0 -150
- package/src/components/panel-title-tab.tsx +0 -60
- package/src/components/win-card/components/ChartContent.tsx +0 -47
- package/src/components/win-card/components/Indicator.tsx +0 -42
- package/src/components/win-card/components/IndicatorArea.tsx +0 -63
- package/src/components/win-card/components/IndicatorInfo.tsx +0 -78
- package/src/components/win-card/components/MatterContent.tsx +0 -121
- package/src/components/win-card/components/MatterList.tsx +0 -141
- package/src/components/win-card/components/NoticeContent.tsx +0 -73
- package/src/components/win-card/components/NoticeList.tsx +0 -68
- package/src/components/win-card/components/SelectDecoration.tsx +0 -34
- package/src/components/win-card/components/WinRankContent.tsx +0 -102
- package/src/components/win-card/index.tsx +0 -298
- package/src/components/win-card/utils/interface.ts +0 -12
- package/src/components/win-card/utils/tool.ts +0 -11
- package/src/components/win-card-mobile/components/ChartContent.tsx +0 -47
- package/src/components/win-card-mobile/components/DualLineBar.tsx +0 -61
- package/src/components/win-card-mobile/components/Indicator.tsx +0 -42
- package/src/components/win-card-mobile/components/IndicatorArea.tsx +0 -65
- package/src/components/win-card-mobile/components/IndicatorInfo.tsx +0 -83
- package/src/components/win-card-mobile/components/SelectDecoration.tsx +0 -28
- package/src/components/win-card-mobile/index.tsx +0 -235
- package/src/components/win-card-mobile/utils/interface.ts +0 -12
- package/src/components/win-card-mobile/utils/tool.ts +0 -9
- package/src/components/win-chart/components/chart-wrapper.tsx +0 -5
- package/src/components/win-chart/index.tsx +0 -59
- package/src/components/win-chart/theme/win-dark.json +0 -372
- package/src/components/win-chart/theme/win-light.json +0 -372
- package/src/components/win-chart/utils/const.ts +0 -37
- package/src/components/win-chart/utils/getAreaSpec.ts +0 -150
- package/src/components/win-chart/utils/getBarSpec.ts +0 -60
- package/src/components/win-chart/utils/getChartOptions.ts +0 -59
- package/src/components/win-chart/utils/getColumnSpec.ts +0 -112
- package/src/components/win-chart/utils/getDualSpec.ts +0 -79
- package/src/components/win-chart/utils/getFunnelSpec.ts +0 -70
- package/src/components/win-chart/utils/getLineSpec.ts +0 -53
- package/src/components/win-chart/utils/getPieSpec.ts +0 -124
- package/src/components/win-chart/utils/getRadarSpec.ts +0 -87
- package/src/components/win-chart/utils/tool.ts +0 -163
- package/src/components/win-chart/utils/type.ts +0 -96
- package/src/components/win-icon/index.tsx +0 -97
- package/src/components/win-v/components/EmptyBox.tsx +0 -9
- package/src/components/win-v/components/VDialog.tsx +0 -173
- package/src/components/win-v/components/VDialogBtn.tsx +0 -119
- package/src/components/win-v/components/VDialogMsg.tsx +0 -325
- package/src/components/win-v/components/VInput.tsx +0 -15
- package/src/components/win-v/components/VRemindMsgList.tsx +0 -303
- package/src/components/win-v/components/VRobot.tsx +0 -97
- package/src/components/win-v/hooks/useVDialogCore.ts +0 -102
- package/src/components/win-v/hooks/useVDialogOperate.ts +0 -132
- package/src/components/win-v/hooks/useVDialogState.ts +0 -52
- package/src/components/win-v/hooks/useVRemindMsgShow.ts +0 -15
- package/src/components/win-v/index.tsx +0 -205
- package/src/components/win-wrappers/card-wrapper.tsx +0 -103
- package/src/components/win-wrappers/dot-wrapper.tsx +0 -18
- package/src/components/win-wrappers/iframe-wrapper.tsx +0 -7
- package/src/components/win-wrappers/request-wrapper.tsx +0 -190
- package/src/global.d.ts +0 -53
- package/src/hooks/useCardOptionList.ts +0 -23
- package/src/hooks/useCostFiltersDicList.ts +0 -22
- package/src/hooks/useFbiUrl.ts +0 -22
- package/src/hooks/useHalfScreenState.ts +0 -50
- package/src/hooks/useHasIntersected.ts +0 -36
- package/src/hooks/useIndicatorCardInfo.ts +0 -26
- package/src/hooks/useIndicatorCardQueryList.ts +0 -22
- package/src/hooks/useIndicatorClassifyList.ts +0 -25
- package/src/hooks/useIndicatorDetailsDateList.ts +0 -22
- package/src/hooks/useIndicatorDetailsInfo.ts +0 -49
- package/src/hooks/useIndicatorDetailsTrend.ts +0 -25
- package/src/hooks/useIndicatorDicList.ts +0 -22
- package/src/hooks/useIndicatorLabelList.ts +0 -20
- package/src/hooks/useIndicatorList.ts +0 -24
- package/src/hooks/useIndicatorRangeList.ts +0 -20
- package/src/hooks/useIndicatorTypeList.ts +0 -20
- package/src/hooks/useIndicatorUnitList.ts +0 -21
- package/src/hooks/useListenQuery.ts +0 -29
- package/src/hooks/useMobile.ts +0 -58
- package/src/hooks/useNotice.ts +0 -42
- package/src/hooks/useOrgLevelList.ts +0 -23
- package/src/hooks/usePageSelection.ts +0 -121
- package/src/hooks/usePageState.ts +0 -22
- package/src/hooks/usePendingList.ts +0 -27
- package/src/hooks/usePortalPageInfo.ts +0 -43
- package/src/hooks/useRefreshByLocationChange.ts +0 -16
- package/src/hooks/useReportIndicatorList.ts +0 -21
- package/src/hooks/useReportInfo.ts +0 -45
- package/src/hooks/useReportPersonList.ts +0 -21
- package/src/hooks/useScriptLoader.ts +0 -22
- package/src/hooks/useUnreadMsgList.ts +0 -26
- package/src/hooks/useUserAvatar.ts +0 -23
- package/src/hooks/useVReportInfo.ts +0 -50
- package/src/hooks/useVisionUserConfig.ts +0 -25
- package/src/hooks/useWorkbenchOptions.ts +0 -63
- package/src/index.tsx +0 -20
- package/src/services/CardService.ts +0 -91
- package/src/services/CommonService.ts +0 -23
- package/src/services/CostService.ts +0 -56
- package/src/services/DialogService.ts +0 -74
- package/src/services/IndicatorService.ts +0 -406
- package/src/services/PageService.ts +0 -204
- package/src/services/ReportService.ts +0 -335
- package/src/services/WorkbenchService.ts +0 -411
- package/src/styles/README.md +0 -12
- package/src/styles/index.scss +0 -9
- package/src/styles/mixins/index.scss +0 -25
- package/src/styles/next-cover.scss +0 -4
- package/src/styles/normalize.scss +0 -27
- package/src/styles/utilities/index.scss +0 -5
- package/src/styles/vars/index.scss +0 -17
- package/src/types/enum-workbench.ts +0 -29
- package/src/types/enum.ts +0 -156
- package/src/types/index.ts +0 -19
- package/src/types/indicator.ts +0 -299
- package/src/types/interface.ts +0 -303
- package/src/types/portal.ts +0 -211
- package/src/types/report.ts +0 -28
- package/src/types/type.ts +0 -11
- package/src/types/user.ts +0 -28
- package/src/utils/README.md +0 -4
- package/src/utils/arms.ts +0 -59
- package/src/utils/arr.ts +0 -123
- package/src/utils/const-workbench.ts +0 -9
- package/src/utils/const.ts +0 -18
- package/src/utils/index.ts +0 -18
- package/src/utils/init.ts +0 -5
- package/src/utils/map-workbench.ts +0 -66
- package/src/utils/map.ts +0 -377
- package/src/utils/number.ts +0 -101
- package/src/utils/page.ts +0 -81
- package/src/utils/str.ts +0 -26
- package/src/utils/tools.ts +0 -44
- package/src/utils/tree.ts +0 -145
- package/src/utils/url.ts +0 -40
- package/src/utils/util.ts +0 -99
- package/src/utils/workbench.ts +0 -25
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { CnBox } from '@cainiaofe/cn-ui';
|
|
2
|
-
import { Fragment } from 'react';
|
|
3
|
-
import { HoverView } from 'src/components/hover-view';
|
|
4
|
-
import { RequestWrapper } from 'src/components/win-wrappers/request-wrapper';
|
|
5
|
-
import { WorkbenchService } from 'src/services/WorkbenchService';
|
|
6
|
-
import { styled } from 'styled-components';
|
|
7
|
-
|
|
8
|
-
export const WinRankContent = () => {
|
|
9
|
-
return (
|
|
10
|
-
<RequestWrapper service={WorkbenchService.queryWinRankList}>
|
|
11
|
-
{(data) => {
|
|
12
|
-
return (
|
|
13
|
-
<Wrapper>
|
|
14
|
-
{data.map((item, index) => (
|
|
15
|
-
<div key={item.title}>
|
|
16
|
-
<div data-title>{item.title}</div>
|
|
17
|
-
<div data-content>
|
|
18
|
-
{item.list?.map((info, i) => {
|
|
19
|
-
const isTopFive = i < 5;
|
|
20
|
-
const getMarginStyle = () => {
|
|
21
|
-
if (i === 4) {
|
|
22
|
-
return {
|
|
23
|
-
marginBottom: 4,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
return (
|
|
28
|
-
<Fragment key={info.label + info.children}>
|
|
29
|
-
{index === 0 ? (
|
|
30
|
-
<Mark style={getMarginStyle()}>
|
|
31
|
-
{isTopFive ? '❤️' : '💪'}
|
|
32
|
-
</Mark>
|
|
33
|
-
) : (
|
|
34
|
-
<InfoDecoration
|
|
35
|
-
style={{
|
|
36
|
-
backgroundColor: isTopFive
|
|
37
|
-
? 'rgba(250,107,105,0.1)'
|
|
38
|
-
: 'rgba(177,185,199,0.2)',
|
|
39
|
-
...getMarginStyle(),
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
<div data-label>
|
|
43
|
-
<HoverView content={info.label} />
|
|
44
|
-
</div>
|
|
45
|
-
<span>{info.value}</span>
|
|
46
|
-
</InfoDecoration>
|
|
47
|
-
)}
|
|
48
|
-
</Fragment>
|
|
49
|
-
);
|
|
50
|
-
})}
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
))}
|
|
54
|
-
</Wrapper>
|
|
55
|
-
);
|
|
56
|
-
}}
|
|
57
|
-
</RequestWrapper>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const Wrapper = styled.div`
|
|
62
|
-
display: grid;
|
|
63
|
-
grid: auto-flow / 36px repeat(4, 1fr);
|
|
64
|
-
gap: 8px;
|
|
65
|
-
overflow: auto;
|
|
66
|
-
|
|
67
|
-
[data-title] {
|
|
68
|
-
font-weight: 500;
|
|
69
|
-
font-size: 12px;
|
|
70
|
-
color: #394252;
|
|
71
|
-
line-height: 1;
|
|
72
|
-
margin-bottom: 16px;
|
|
73
|
-
display: grid;
|
|
74
|
-
place-items: center;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
[data-content] {
|
|
78
|
-
display: grid;
|
|
79
|
-
grid: auto-flow 24px / 1fr;
|
|
80
|
-
gap: 12px;
|
|
81
|
-
}
|
|
82
|
-
`;
|
|
83
|
-
|
|
84
|
-
const Mark = styled.div`
|
|
85
|
-
display: grid;
|
|
86
|
-
place-items: center;
|
|
87
|
-
`;
|
|
88
|
-
|
|
89
|
-
const InfoDecoration = styled(CnBox).attrs({
|
|
90
|
-
direction: 'row',
|
|
91
|
-
justify: 'space-between',
|
|
92
|
-
align: 'center',
|
|
93
|
-
})`
|
|
94
|
-
border-radius: 500px;
|
|
95
|
-
font-size: 12px;
|
|
96
|
-
color: #272f3d;
|
|
97
|
-
padding: 0 10px;
|
|
98
|
-
|
|
99
|
-
[data-label] {
|
|
100
|
-
width: 80px;
|
|
101
|
-
}
|
|
102
|
-
`;
|
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import $i18n from 'panda-i18n';
|
|
2
|
-
import { IndicatorService } from 'src/services/IndicatorService';
|
|
3
|
-
import { IIndicatorCardConfig } from '@/types';
|
|
4
|
-
import { IndicatorArea } from './components/IndicatorArea';
|
|
5
|
-
import { RequestWrapper } from '../win-wrappers/request-wrapper';
|
|
6
|
-
import { CardTitleWrapper, CardWrapper } from '../win-wrappers/card-wrapper';
|
|
7
|
-
import { WinCardChartType } from 'src/types/enum';
|
|
8
|
-
import { INDICATOR_CONFIG_BASE_URL } from '../../utils/const';
|
|
9
|
-
import { MatterContent } from './components/MatterContent';
|
|
10
|
-
import { Indicator } from './components/Indicator';
|
|
11
|
-
import { ChartContent } from './components/ChartContent';
|
|
12
|
-
import { CnBox, CnDropdown, CnMenu, CnMenuItem, Icon } from '@cainiaofe/cn-ui';
|
|
13
|
-
import {
|
|
14
|
-
IndicatorSelectDecoration,
|
|
15
|
-
SelectDecoration,
|
|
16
|
-
} from './components/SelectDecoration';
|
|
17
|
-
import {
|
|
18
|
-
checkEntityArr,
|
|
19
|
-
getHandleOpenLink,
|
|
20
|
-
getListLabel,
|
|
21
|
-
unitList,
|
|
22
|
-
} from 'src/utils';
|
|
23
|
-
import { CSSProperties, useContext, useEffect, useRef, useState } from 'react';
|
|
24
|
-
import { HoverView } from '../hover-view';
|
|
25
|
-
import { useCardOptionList } from 'src/hooks/useCardOptionList';
|
|
26
|
-
import { VisionUserConfigContext } from '../VisionUserConfigContext';
|
|
27
|
-
import { WinChartType } from '../win-chart';
|
|
28
|
-
import { WinRankContent } from './components/WinRankContent';
|
|
29
|
-
import { useHasIntersected } from '@/hooks/useHasIntersected';
|
|
30
|
-
|
|
31
|
-
interface IProps {
|
|
32
|
-
id: number;
|
|
33
|
-
config?: IIndicatorCardConfig;
|
|
34
|
-
style?: CSSProperties;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const WinCard = ({ id, config, style }: IProps) => {
|
|
38
|
-
if (config) {
|
|
39
|
-
return <ShowCard configData={config} style={style} />;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<RequestWrapper
|
|
44
|
-
requestData={{ url: `${INDICATOR_CONFIG_BASE_URL}?id=${id}` }}
|
|
45
|
-
service={IndicatorService.getConfigInfo}
|
|
46
|
-
style={{
|
|
47
|
-
width: '100%',
|
|
48
|
-
height: '100%',
|
|
49
|
-
...style,
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
{(configData) => {
|
|
53
|
-
return (
|
|
54
|
-
<ShowCard
|
|
55
|
-
configData={configData}
|
|
56
|
-
style={{ height: configData.colHeight * 128 }}
|
|
57
|
-
/>
|
|
58
|
-
);
|
|
59
|
-
}}
|
|
60
|
-
</RequestWrapper>
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const ShowCard = ({
|
|
65
|
-
configData,
|
|
66
|
-
style,
|
|
67
|
-
}: {
|
|
68
|
-
configData: IIndicatorCardConfig;
|
|
69
|
-
style?: CSSProperties;
|
|
70
|
-
}) => {
|
|
71
|
-
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
72
|
-
const hasIntersected = useHasIntersected(wrapperRef);
|
|
73
|
-
const orgLevelList = useCardOptionList(
|
|
74
|
-
hasIntersected && configData.commonConfig.orgLevel
|
|
75
|
-
? configData.id
|
|
76
|
-
: undefined,
|
|
77
|
-
);
|
|
78
|
-
const [curOrgLevelValue, setCurOrgLevelValue] = useState<string>();
|
|
79
|
-
const isSingleIndicator = configData.chartType === WinCardChartType.INDICATOR;
|
|
80
|
-
const hasOrgLevel = !!configData.commonConfig.orgLevel;
|
|
81
|
-
const isCommonTitle = ![WinCardChartType.CUSTOM_CARD].includes(
|
|
82
|
-
configData.chartType,
|
|
83
|
-
);
|
|
84
|
-
const jumpUrl = configData.detailUrl;
|
|
85
|
-
const menuItems = [
|
|
86
|
-
...(jumpUrl
|
|
87
|
-
? [
|
|
88
|
-
<CnMenuItem key="jump" onClick={getHandleOpenLink(jumpUrl)}>
|
|
89
|
-
{$i18n.get({ id: 'ViewDetails', dm: '查看详情' })}
|
|
90
|
-
</CnMenuItem>,
|
|
91
|
-
]
|
|
92
|
-
: []),
|
|
93
|
-
];
|
|
94
|
-
|
|
95
|
-
const visionUserConfig = useContext(VisionUserConfigContext);
|
|
96
|
-
const hasInitOrgLevelRef = useRef(false);
|
|
97
|
-
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
if (orgLevelList.length !== 0 && visionUserConfig) {
|
|
100
|
-
const configOrgLevelVal =
|
|
101
|
-
visionUserConfig[configData.commonConfig.orgLevel];
|
|
102
|
-
const valueInList = orgLevelList
|
|
103
|
-
.map((item) => item.value)
|
|
104
|
-
.includes(configOrgLevelVal);
|
|
105
|
-
|
|
106
|
-
if (!hasInitOrgLevelRef.current) {
|
|
107
|
-
// 第一次赋值
|
|
108
|
-
setCurOrgLevelValue(
|
|
109
|
-
valueInList ? configOrgLevelVal : orgLevelList[0].value,
|
|
110
|
-
);
|
|
111
|
-
hasInitOrgLevelRef.current = true;
|
|
112
|
-
} else {
|
|
113
|
-
// 用户配置切换赋值
|
|
114
|
-
if (valueInList) {
|
|
115
|
-
setCurOrgLevelValue(configOrgLevelVal);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}, [configData.commonConfig.orgLevel, orgLevelList, visionUserConfig]);
|
|
120
|
-
|
|
121
|
-
// 单位
|
|
122
|
-
const unit = getListLabel(unitList, configData.indicatorConfig[0]?.unit);
|
|
123
|
-
|
|
124
|
-
return (
|
|
125
|
-
<CardWrapper ref={wrapperRef} style={style}>
|
|
126
|
-
{isCommonTitle && (
|
|
127
|
-
<CnBox direction="row" justify="space-between" style={{ height: 20 }}>
|
|
128
|
-
<CardTitleWrapper
|
|
129
|
-
data-card-id={configData.id}
|
|
130
|
-
style={{
|
|
131
|
-
maxWidth: isSingleIndicator || !hasOrgLevel ? '80%' : '45%',
|
|
132
|
-
position: 'relative',
|
|
133
|
-
...([
|
|
134
|
-
WinCardChartType.INDICATOR,
|
|
135
|
-
WinCardChartType.INDICATOR_AREA,
|
|
136
|
-
].includes(configData.chartType) && {
|
|
137
|
-
fontSize: '12px',
|
|
138
|
-
fontWeight: 'normal',
|
|
139
|
-
}),
|
|
140
|
-
}}
|
|
141
|
-
>
|
|
142
|
-
<HoverView content={configData.name} />
|
|
143
|
-
</CardTitleWrapper>
|
|
144
|
-
<CnBox direction="row" align="center">
|
|
145
|
-
{hasOrgLevel && !isSingleIndicator && (
|
|
146
|
-
<SelectDecoration
|
|
147
|
-
value={curOrgLevelValue}
|
|
148
|
-
dataSource={orgLevelList}
|
|
149
|
-
onChange={setCurOrgLevelValue}
|
|
150
|
-
/>
|
|
151
|
-
)}
|
|
152
|
-
|
|
153
|
-
{checkEntityArr(menuItems) && (
|
|
154
|
-
<div
|
|
155
|
-
style={{ transform: 'translate(8px, -4px) rotate(0.25turn)' }}
|
|
156
|
-
>
|
|
157
|
-
<CnDropdown
|
|
158
|
-
trigger={
|
|
159
|
-
<Icon type="ellipsis" style={{ cursor: 'pointer' }} />
|
|
160
|
-
}
|
|
161
|
-
>
|
|
162
|
-
<CnMenu style={{ width: 15 }}>{menuItems}</CnMenu>
|
|
163
|
-
</CnDropdown>
|
|
164
|
-
</div>
|
|
165
|
-
)}
|
|
166
|
-
</CnBox>
|
|
167
|
-
</CnBox>
|
|
168
|
-
)}
|
|
169
|
-
|
|
170
|
-
{getShowContent({
|
|
171
|
-
configData,
|
|
172
|
-
hasOrgLevel,
|
|
173
|
-
orgLevelVal: curOrgLevelValue,
|
|
174
|
-
unit,
|
|
175
|
-
})}
|
|
176
|
-
{isSingleIndicator && (
|
|
177
|
-
<CnBox spacing={8}>
|
|
178
|
-
{hasOrgLevel && (
|
|
179
|
-
<IndicatorSelectDecoration
|
|
180
|
-
value={curOrgLevelValue}
|
|
181
|
-
dataSource={orgLevelList}
|
|
182
|
-
onChange={setCurOrgLevelValue}
|
|
183
|
-
/>
|
|
184
|
-
)}
|
|
185
|
-
</CnBox>
|
|
186
|
-
)}
|
|
187
|
-
</CardWrapper>
|
|
188
|
-
);
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const getShowContent = ({
|
|
192
|
-
configData,
|
|
193
|
-
hasOrgLevel,
|
|
194
|
-
orgLevelVal,
|
|
195
|
-
unit,
|
|
196
|
-
}: {
|
|
197
|
-
configData: IIndicatorCardConfig;
|
|
198
|
-
orgLevelVal?: string;
|
|
199
|
-
unit?: string;
|
|
200
|
-
hasOrgLevel: boolean;
|
|
201
|
-
color?: string[];
|
|
202
|
-
}) => {
|
|
203
|
-
const data = {
|
|
204
|
-
configData,
|
|
205
|
-
orgLevelVal,
|
|
206
|
-
unit,
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
if (hasOrgLevel && !orgLevelVal) {
|
|
210
|
-
return null;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
switch (configData.chartType) {
|
|
214
|
-
case WinCardChartType.INDICATOR:
|
|
215
|
-
return <Indicator {...data} />;
|
|
216
|
-
|
|
217
|
-
case WinCardChartType.INDICATOR_AREA:
|
|
218
|
-
return <IndicatorArea {...data} />;
|
|
219
|
-
|
|
220
|
-
case WinCardChartType.DUAL_LINE_BAR_CHART:
|
|
221
|
-
return (
|
|
222
|
-
<ChartContent winChartType={WinChartType.DUAL_LINE_BAR} {...data} />
|
|
223
|
-
);
|
|
224
|
-
|
|
225
|
-
case WinCardChartType.AREA_CHART:
|
|
226
|
-
return <ChartContent winChartType={WinChartType.AREA} {...data} />;
|
|
227
|
-
|
|
228
|
-
case WinCardChartType.LINE_CHART:
|
|
229
|
-
return <ChartContent winChartType={WinChartType.LINE} {...data} />;
|
|
230
|
-
|
|
231
|
-
case WinCardChartType.COLUMN_CHART:
|
|
232
|
-
return <ChartContent winChartType={WinChartType.COLUMN} {...data} />;
|
|
233
|
-
|
|
234
|
-
case WinCardChartType.STACK_COLUMN_CHART:
|
|
235
|
-
return (
|
|
236
|
-
<ChartContent winChartType={WinChartType.STACK_COLUMN} {...data} />
|
|
237
|
-
);
|
|
238
|
-
|
|
239
|
-
case WinCardChartType.FUNNEL_CHART:
|
|
240
|
-
return <ChartContent winChartType={WinChartType.FUNNEL} {...data} />;
|
|
241
|
-
|
|
242
|
-
case WinCardChartType.BAR_CHART:
|
|
243
|
-
return <ChartContent winChartType={WinChartType.BAR} {...data} />;
|
|
244
|
-
|
|
245
|
-
case WinCardChartType.PIE_CHART:
|
|
246
|
-
return <ChartContent winChartType={WinChartType.PIE} {...data} />;
|
|
247
|
-
|
|
248
|
-
case WinCardChartType.PIE_CHART_RESERVE:
|
|
249
|
-
return (
|
|
250
|
-
<ChartContent
|
|
251
|
-
reserveValueWithLabelType
|
|
252
|
-
winChartType={WinChartType.PIE}
|
|
253
|
-
{...data}
|
|
254
|
-
/>
|
|
255
|
-
);
|
|
256
|
-
|
|
257
|
-
case WinCardChartType.CYCLE_CHART:
|
|
258
|
-
return <ChartContent winChartType={WinChartType.CYCLE} {...data} />;
|
|
259
|
-
|
|
260
|
-
case WinCardChartType.RADAR_CHART:
|
|
261
|
-
return <ChartContent winChartType={WinChartType.RADAR} {...data} />;
|
|
262
|
-
|
|
263
|
-
case WinCardChartType.RADAR_CHART_RESERVE:
|
|
264
|
-
return (
|
|
265
|
-
<ChartContent
|
|
266
|
-
reserveValueWithLabelType
|
|
267
|
-
winChartType={WinChartType.RADAR}
|
|
268
|
-
{...data}
|
|
269
|
-
/>
|
|
270
|
-
);
|
|
271
|
-
|
|
272
|
-
case WinCardChartType.CUSTOM_CARD:
|
|
273
|
-
return getCustomCardContent(configData.name);
|
|
274
|
-
|
|
275
|
-
default:
|
|
276
|
-
return undefined;
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
const getCustomCardContent = (name: string) => {
|
|
281
|
-
switch (name) {
|
|
282
|
-
case 'WIN排行榜':
|
|
283
|
-
return <WinRankContent />;
|
|
284
|
-
|
|
285
|
-
case '工作台待办':
|
|
286
|
-
return <MatterContent />;
|
|
287
|
-
|
|
288
|
-
default:
|
|
289
|
-
return (
|
|
290
|
-
<div>
|
|
291
|
-
{$i18n.get({
|
|
292
|
-
id: 'TheCustomSliceWasNotFoundPleaseC_1572163781',
|
|
293
|
-
dm: '未找到该自定义该片,请检查名称是否正确',
|
|
294
|
-
})}
|
|
295
|
-
</div>
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { IndicatorService } from 'src/services/IndicatorService';
|
|
2
|
-
import { INDICATOR_DATA_BASE_URL, handleAddQuery } from '@/utils';
|
|
3
|
-
import { IContentProps } from '../utils/interface';
|
|
4
|
-
import { RequestWrapper } from 'src/components/win-wrappers/request-wrapper';
|
|
5
|
-
import { WinChart, WinChartType } from 'src/components/win-chart';
|
|
6
|
-
|
|
7
|
-
interface IProps extends IContentProps {
|
|
8
|
-
winChartType: WinChartType;
|
|
9
|
-
reserveValueWithLabelType?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const ChartContent = ({
|
|
13
|
-
configData,
|
|
14
|
-
orgLevelVal,
|
|
15
|
-
winChartType,
|
|
16
|
-
reserveValueWithLabelType,
|
|
17
|
-
}: IProps) => {
|
|
18
|
-
return (
|
|
19
|
-
<RequestWrapper
|
|
20
|
-
requestData={{
|
|
21
|
-
url: handleAddQuery(INDICATOR_DATA_BASE_URL, {
|
|
22
|
-
id: configData.id,
|
|
23
|
-
dataAccVal: configData.dataAccCode,
|
|
24
|
-
orgLevelVal,
|
|
25
|
-
}),
|
|
26
|
-
}}
|
|
27
|
-
service={IndicatorService.getDataInfoList}
|
|
28
|
-
>
|
|
29
|
-
{(data) => {
|
|
30
|
-
return (
|
|
31
|
-
<WinChart
|
|
32
|
-
sort={configData.commonConfig.sort}
|
|
33
|
-
yStart={configData.commonConfig.yStart}
|
|
34
|
-
color={configData.commonConfig.color}
|
|
35
|
-
xAxisLabelLength={configData.commonConfig.xAxisLabelLength}
|
|
36
|
-
xAxisLabelRotate={configData.commonConfig.xAxisLabelRotate}
|
|
37
|
-
reserveValueWithLabelType={reserveValueWithLabelType}
|
|
38
|
-
data={data.list0}
|
|
39
|
-
extraData={data.list1}
|
|
40
|
-
chartType={winChartType}
|
|
41
|
-
style={{ height: 'calc(100% - 0.4rem)' }}
|
|
42
|
-
/>
|
|
43
|
-
);
|
|
44
|
-
}}
|
|
45
|
-
</RequestWrapper>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { IndicatorService } from 'src/services/IndicatorService';
|
|
2
|
-
import {
|
|
3
|
-
arrayDeduplication,
|
|
4
|
-
getListLabel,
|
|
5
|
-
handleAddQuery,
|
|
6
|
-
unitList,
|
|
7
|
-
} from '@/utils';
|
|
8
|
-
import { IContentProps } from '../utils/interface';
|
|
9
|
-
import { RequestWrapper } from 'src/components/win-wrappers/request-wrapper';
|
|
10
|
-
import { INDICATOR_DATA_BASE_URL } from '../../../utils/const';
|
|
11
|
-
import { WinChart, WinChartType } from 'src/components/win-chart';
|
|
12
|
-
import { UnitWrapper } from 'src/components/win-wrappers/card-wrapper';
|
|
13
|
-
|
|
14
|
-
export const DualLineBar = ({ configData, orgLevelVal }: IContentProps) => {
|
|
15
|
-
const units =
|
|
16
|
-
arrayDeduplication(configData.indicatorConfig.map((item) => item.unit)) ??
|
|
17
|
-
[];
|
|
18
|
-
const unit0 = getListLabel(unitList, units[0]);
|
|
19
|
-
const unit1 = getListLabel(unitList, units[1]);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<RequestWrapper
|
|
23
|
-
requestData={{
|
|
24
|
-
url: handleAddQuery(INDICATOR_DATA_BASE_URL, {
|
|
25
|
-
id: configData.id,
|
|
26
|
-
dataAccVal: configData.dataAccCode,
|
|
27
|
-
orgLevelVal,
|
|
28
|
-
}),
|
|
29
|
-
}}
|
|
30
|
-
service={IndicatorService.getDataInfoList}
|
|
31
|
-
>
|
|
32
|
-
{(data) => {
|
|
33
|
-
return (
|
|
34
|
-
<div
|
|
35
|
-
style={{
|
|
36
|
-
height: '100%',
|
|
37
|
-
position: 'relative',
|
|
38
|
-
}}
|
|
39
|
-
>
|
|
40
|
-
<WinChart
|
|
41
|
-
chartType={WinChartType.DUAL_LINE_BAR}
|
|
42
|
-
data={data.list0 ?? []}
|
|
43
|
-
extraData={data.list1 ?? []}
|
|
44
|
-
/>
|
|
45
|
-
{/* {!!unit0 && (
|
|
46
|
-
<UnitWrapper
|
|
47
|
-
style={{
|
|
48
|
-
position: 'absolute',
|
|
49
|
-
left: 0,
|
|
50
|
-
bottom: 14,
|
|
51
|
-
}}
|
|
52
|
-
>
|
|
53
|
-
({unit0}, {unit1})
|
|
54
|
-
</UnitWrapper>
|
|
55
|
-
)} */}
|
|
56
|
-
</div>
|
|
57
|
-
);
|
|
58
|
-
}}
|
|
59
|
-
</RequestWrapper>
|
|
60
|
-
);
|
|
61
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { IndicatorService } from 'src/services/IndicatorService';
|
|
2
|
-
import { handleAddQuery, INDICATOR_DATA_BASE_URL } from '@/utils';
|
|
3
|
-
import { IContentProps } from '../utils/interface';
|
|
4
|
-
import { RequestWrapper } from 'src/components/win-wrappers/request-wrapper';
|
|
5
|
-
import { getExtraLabel } from '../utils/tool';
|
|
6
|
-
import { IndicatorInfo } from './IndicatorInfo';
|
|
7
|
-
|
|
8
|
-
export const Indicator = ({ configData, unit, orgLevelVal }: IContentProps) => {
|
|
9
|
-
return (
|
|
10
|
-
<RequestWrapper
|
|
11
|
-
errorBoxHeight={50}
|
|
12
|
-
noEmptyBox
|
|
13
|
-
requestData={{
|
|
14
|
-
url: handleAddQuery(INDICATOR_DATA_BASE_URL, {
|
|
15
|
-
id: configData.id,
|
|
16
|
-
dataAccVal: configData.dataAccCode,
|
|
17
|
-
orgLevelVal,
|
|
18
|
-
}),
|
|
19
|
-
}}
|
|
20
|
-
service={IndicatorService.getDataInfoList}
|
|
21
|
-
style={{
|
|
22
|
-
height: 'auto',
|
|
23
|
-
}}
|
|
24
|
-
>
|
|
25
|
-
{(data) => {
|
|
26
|
-
const curConfig = configData.indicatorConfig[0];
|
|
27
|
-
const subTitle = curConfig.extra?.subTitle;
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<IndicatorInfo
|
|
31
|
-
jumpUrl={`/#/h5/indicator-details?id=${curConfig.id}`}
|
|
32
|
-
label={configData.name}
|
|
33
|
-
unit={unit}
|
|
34
|
-
value={data.indicator?.value}
|
|
35
|
-
extraLabel={getExtraLabel(subTitle) ?? data.indicator?.date}
|
|
36
|
-
extraValue={data.indicator?.expected}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
}}
|
|
40
|
-
</RequestWrapper>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { IndicatorService } from 'src/services/IndicatorService';
|
|
2
|
-
import {
|
|
3
|
-
getListLabel,
|
|
4
|
-
handleAddQuery,
|
|
5
|
-
handleNumberShowStr,
|
|
6
|
-
unitList,
|
|
7
|
-
} from '@/utils';
|
|
8
|
-
import { IContentProps } from '../utils/interface';
|
|
9
|
-
import { RequestWrapper } from 'src/components/win-wrappers/request-wrapper';
|
|
10
|
-
import { INDICATOR_DATA_BASE_URL } from '../../../utils/const';
|
|
11
|
-
import { WinChart, WinChartType } from 'src/components/win-chart';
|
|
12
|
-
import { getExtraLabel } from '../utils/tool';
|
|
13
|
-
import { IndicatorInfo } from './IndicatorInfo';
|
|
14
|
-
|
|
15
|
-
export const IndicatorArea = ({ configData, orgLevelVal }: IContentProps) => {
|
|
16
|
-
return (
|
|
17
|
-
<RequestWrapper
|
|
18
|
-
errorBoxHeight={50}
|
|
19
|
-
requestData={{
|
|
20
|
-
url: handleAddQuery(INDICATOR_DATA_BASE_URL, {
|
|
21
|
-
id: configData.id,
|
|
22
|
-
dataAccVal: configData.dataAccCode,
|
|
23
|
-
orgLevelVal,
|
|
24
|
-
}),
|
|
25
|
-
}}
|
|
26
|
-
service={IndicatorService.getDataInfoList}
|
|
27
|
-
>
|
|
28
|
-
{(data) => {
|
|
29
|
-
const curConfig = configData.indicatorConfig[0];
|
|
30
|
-
const subTitle = curConfig.extra?.subTitle;
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<div
|
|
34
|
-
style={{
|
|
35
|
-
display: 'grid',
|
|
36
|
-
grid: 'auto-flow / 4fr 6fr',
|
|
37
|
-
gap: '0.24rem',
|
|
38
|
-
transform: 'translateY(0.08rem)',
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
<IndicatorInfo
|
|
42
|
-
jumpUrl={`/#/h5/indicator-details?id=${curConfig.id}`}
|
|
43
|
-
label={configData.name}
|
|
44
|
-
unit={getListLabel(unitList, configData.indicatorConfig[0]?.unit)}
|
|
45
|
-
value={handleNumberShowStr(data.indicator?.value)}
|
|
46
|
-
extraLabel={getExtraLabel(subTitle) ?? data.indicator?.date}
|
|
47
|
-
extraValue={data.indicator?.expected}
|
|
48
|
-
style={{
|
|
49
|
-
transform: 'translateY(0.12rem)',
|
|
50
|
-
}}
|
|
51
|
-
/>
|
|
52
|
-
<WinChart
|
|
53
|
-
color={configData.commonConfig.color}
|
|
54
|
-
data={data.list0 ?? []}
|
|
55
|
-
chartType={WinChartType.MINI_AREA}
|
|
56
|
-
style={{
|
|
57
|
-
height: '1.6rem',
|
|
58
|
-
}}
|
|
59
|
-
/>
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
}}
|
|
63
|
-
</RequestWrapper>
|
|
64
|
-
);
|
|
65
|
-
};
|