win-chart 1.0.0
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/.eslintrc.json +3 -0
- package/.prettierrc.json +5 -0
- package/README.md +0 -0
- package/localhost-key.pem +28 -0
- package/localhost.pem +25 -0
- package/package.json +65 -0
- package/rsbuild.config.ts +48 -0
- package/src/api/README.md +15 -0
- package/src/api/index.js +5 -0
- package/src/api/layout/index.js +32 -0
- package/src/api/request.ts +87 -0
- package/src/api/url-map/index.js +10 -0
- package/src/api/user/index.js +12 -0
- package/src/components/FilterContext.tsx +6 -0
- package/src/components/GlobalStyle.tsx +25 -0
- package/src/components/HalfScreenBrowser.tsx +95 -0
- package/src/components/ImgBox.tsx +19 -0
- package/src/components/JumpBtn.tsx +38 -0
- package/src/components/MCardWrapper.tsx +33 -0
- package/src/components/NoContent/index.tsx +85 -0
- package/src/components/ResponsiveReactGridLayout.tsx +218 -0
- package/src/components/SliderDecoration.tsx +27 -0
- package/src/components/VisionUserConfigContext.ts +6 -0
- package/src/components/WinMenu/README.md +11 -0
- package/src/components/WinMenu/WinHeader.tsx +5 -0
- package/src/components/WinMenu/components/ExtraBox.tsx +61 -0
- package/src/components/WinMenu/components/FullMenuBox.tsx +80 -0
- package/src/components/WinMenu/components/FullMenuContainer.tsx +50 -0
- package/src/components/WinMenu/components/FullMenuItem.tsx +128 -0
- package/src/components/WinMenu/components/LangSwitch.tsx +84 -0
- package/src/components/WinMenu/components/LogoBox.tsx +29 -0
- package/src/components/WinMenu/components/PinDialog.tsx +72 -0
- package/src/components/WinMenu/components/PinnedMenuBox.tsx +183 -0
- package/src/components/WinMenu/components/UserBox.tsx +83 -0
- package/src/components/WinMenu/hooks/useUserInfo.ts +21 -0
- package/src/components/WinMenu/hooks/useUserMenu.ts +35 -0
- package/src/components/WinMenu/index.tsx +100 -0
- package/src/components/WinMenu/services/WinService.ts +79 -0
- package/src/components/WinMenu/services/request.ts +53 -0
- package/src/components/WinMenu/utils/const.ts +80 -0
- package/src/components/WinMenu/utils/enum.ts +19 -0
- package/src/components/WinMenu/utils/interface.ts +61 -0
- package/src/components/WinMenu/utils/map.ts +39 -0
- package/src/components/WinMenu/utils/tool.ts +142 -0
- package/src/components/WinMenu/utils/type.ts +1 -0
- package/src/components/hover-view.tsx +48 -0
- package/src/components/icon.tsx +44 -0
- package/src/components/indicator-remark.tsx +25 -0
- package/src/components/none-content.tsx +93 -0
- package/src/components/panel-tab.tsx +150 -0
- package/src/components/panel-title-tab.tsx +60 -0
- package/src/components/win-card/components/ChartContent.tsx +47 -0
- package/src/components/win-card/components/Indicator.tsx +42 -0
- package/src/components/win-card/components/IndicatorArea.tsx +63 -0
- package/src/components/win-card/components/IndicatorInfo.tsx +78 -0
- package/src/components/win-card/components/MatterContent.tsx +121 -0
- package/src/components/win-card/components/MatterList.tsx +141 -0
- package/src/components/win-card/components/NoticeContent.tsx +73 -0
- package/src/components/win-card/components/NoticeList.tsx +68 -0
- package/src/components/win-card/components/SelectDecoration.tsx +34 -0
- package/src/components/win-card/components/WinRankContent.tsx +102 -0
- package/src/components/win-card/index.tsx +298 -0
- package/src/components/win-card/utils/interface.ts +12 -0
- package/src/components/win-card/utils/tool.ts +11 -0
- package/src/components/win-card-mobile/components/ChartContent.tsx +47 -0
- package/src/components/win-card-mobile/components/DualLineBar.tsx +61 -0
- package/src/components/win-card-mobile/components/Indicator.tsx +42 -0
- package/src/components/win-card-mobile/components/IndicatorArea.tsx +65 -0
- package/src/components/win-card-mobile/components/IndicatorInfo.tsx +83 -0
- package/src/components/win-card-mobile/components/SelectDecoration.tsx +28 -0
- package/src/components/win-card-mobile/index.tsx +235 -0
- package/src/components/win-card-mobile/utils/interface.ts +12 -0
- package/src/components/win-card-mobile/utils/tool.ts +9 -0
- package/src/components/win-chart/components/chart-wrapper.tsx +5 -0
- package/src/components/win-chart/index.tsx +59 -0
- package/src/components/win-chart/theme/win-dark.json +372 -0
- package/src/components/win-chart/theme/win-light.json +372 -0
- package/src/components/win-chart/utils/const.ts +37 -0
- package/src/components/win-chart/utils/getAreaSpec.ts +150 -0
- package/src/components/win-chart/utils/getBarSpec.ts +60 -0
- package/src/components/win-chart/utils/getChartOptions.ts +59 -0
- package/src/components/win-chart/utils/getColumnSpec.ts +112 -0
- package/src/components/win-chart/utils/getDualSpec.ts +79 -0
- package/src/components/win-chart/utils/getFunnelSpec.ts +70 -0
- package/src/components/win-chart/utils/getLineSpec.ts +53 -0
- package/src/components/win-chart/utils/getPieSpec.ts +124 -0
- package/src/components/win-chart/utils/getRadarSpec.ts +87 -0
- package/src/components/win-chart/utils/tool.ts +163 -0
- package/src/components/win-chart/utils/type.ts +96 -0
- package/src/components/win-icon/index.tsx +97 -0
- package/src/components/win-v/components/EmptyBox.tsx +9 -0
- package/src/components/win-v/components/VDialog.tsx +173 -0
- package/src/components/win-v/components/VDialogBtn.tsx +119 -0
- package/src/components/win-v/components/VDialogMsg.tsx +325 -0
- package/src/components/win-v/components/VInput.tsx +15 -0
- package/src/components/win-v/components/VRemindMsgList.tsx +303 -0
- package/src/components/win-v/components/VRobot.tsx +97 -0
- package/src/components/win-v/hooks/useVDialogCore.ts +102 -0
- package/src/components/win-v/hooks/useVDialogOperate.ts +132 -0
- package/src/components/win-v/hooks/useVDialogState.ts +52 -0
- package/src/components/win-v/hooks/useVRemindMsgShow.ts +15 -0
- package/src/components/win-v/index.tsx +205 -0
- package/src/components/win-wrappers/card-wrapper.tsx +103 -0
- package/src/components/win-wrappers/dot-wrapper.tsx +18 -0
- package/src/components/win-wrappers/iframe-wrapper.tsx +7 -0
- package/src/components/win-wrappers/request-wrapper.tsx +190 -0
- package/src/global.d.ts +53 -0
- package/src/hooks/useCardOptionList.ts +23 -0
- package/src/hooks/useCostFiltersDicList.ts +22 -0
- package/src/hooks/useFbiUrl.ts +22 -0
- package/src/hooks/useHalfScreenState.ts +50 -0
- package/src/hooks/useHasIntersected.ts +36 -0
- package/src/hooks/useIndicatorCardInfo.ts +26 -0
- package/src/hooks/useIndicatorCardQueryList.ts +22 -0
- package/src/hooks/useIndicatorClassifyList.ts +25 -0
- package/src/hooks/useIndicatorDetailsDateList.ts +22 -0
- package/src/hooks/useIndicatorDetailsInfo.ts +49 -0
- package/src/hooks/useIndicatorDetailsTrend.ts +25 -0
- package/src/hooks/useIndicatorDicList.ts +22 -0
- package/src/hooks/useIndicatorLabelList.ts +20 -0
- package/src/hooks/useIndicatorList.ts +24 -0
- package/src/hooks/useIndicatorRangeList.ts +20 -0
- package/src/hooks/useIndicatorTypeList.ts +20 -0
- package/src/hooks/useIndicatorUnitList.ts +21 -0
- package/src/hooks/useListenQuery.ts +29 -0
- package/src/hooks/useMobile.ts +58 -0
- package/src/hooks/useNotice.ts +42 -0
- package/src/hooks/useOrgLevelList.ts +23 -0
- package/src/hooks/usePageSelection.ts +121 -0
- package/src/hooks/usePageState.ts +22 -0
- package/src/hooks/usePendingList.ts +27 -0
- package/src/hooks/usePortalPageInfo.ts +43 -0
- package/src/hooks/useRefreshByLocationChange.ts +16 -0
- package/src/hooks/useReportIndicatorList.ts +21 -0
- package/src/hooks/useReportInfo.ts +45 -0
- package/src/hooks/useReportPersonList.ts +21 -0
- package/src/hooks/useScriptLoader.ts +22 -0
- package/src/hooks/useUnreadMsgList.ts +26 -0
- package/src/hooks/useUserAvatar.ts +23 -0
- package/src/hooks/useVReportInfo.ts +50 -0
- package/src/hooks/useVisionUserConfig.ts +25 -0
- package/src/hooks/useWorkbenchOptions.ts +63 -0
- package/src/index.tsx +20 -0
- package/src/services/CardService.ts +91 -0
- package/src/services/CommonService.ts +23 -0
- package/src/services/CostService.ts +56 -0
- package/src/services/DialogService.ts +74 -0
- package/src/services/IndicatorService.ts +406 -0
- package/src/services/PageService.ts +204 -0
- package/src/services/ReportService.ts +335 -0
- package/src/services/WorkbenchService.ts +411 -0
- package/src/styles/README.md +12 -0
- package/src/styles/index.scss +9 -0
- package/src/styles/mixins/index.scss +25 -0
- package/src/styles/next-cover.scss +4 -0
- package/src/styles/normalize.scss +27 -0
- package/src/styles/utilities/index.scss +5 -0
- package/src/styles/vars/index.scss +17 -0
- package/src/types/enum-workbench.ts +29 -0
- package/src/types/enum.ts +156 -0
- package/src/types/index.ts +19 -0
- package/src/types/indicator.ts +299 -0
- package/src/types/interface.ts +303 -0
- package/src/types/portal.ts +211 -0
- package/src/types/report.ts +28 -0
- package/src/types/type.ts +11 -0
- package/src/types/user.ts +28 -0
- package/src/utils/README.md +4 -0
- package/src/utils/arms.ts +59 -0
- package/src/utils/arr.ts +123 -0
- package/src/utils/const-workbench.ts +9 -0
- package/src/utils/const.ts +18 -0
- package/src/utils/index.ts +18 -0
- package/src/utils/init.ts +5 -0
- package/src/utils/map-workbench.ts +66 -0
- package/src/utils/map.ts +377 -0
- package/src/utils/number.ts +101 -0
- package/src/utils/page.ts +81 -0
- package/src/utils/str.ts +26 -0
- package/src/utils/tools.ts +44 -0
- package/src/utils/tree.ts +145 -0
- package/src/utils/url.ts +40 -0
- package/src/utils/util.ts +99 -0
- package/src/utils/workbench.ts +25 -0
- package/tsconfig.json +33 -0
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
reserveValueWithLabelType={reserveValueWithLabelType}
|
|
36
|
+
xAxisLabelLength={configData.commonConfig.xAxisLabelLength}
|
|
37
|
+
xAxisLabelRotate={configData.commonConfig.xAxisLabelRotate}
|
|
38
|
+
data={data.list0}
|
|
39
|
+
extraData={data.list1}
|
|
40
|
+
chartType={winChartType}
|
|
41
|
+
style={{ height: 'calc(100% - 20px)' }}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
}}
|
|
45
|
+
</RequestWrapper>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { IndicatorService } from 'src/services/IndicatorService';
|
|
2
|
+
import { handleAddQuery, INDICATOR_DATA_BASE_URL } from '@/utils';
|
|
3
|
+
import { IContentProps } from '../utils/interface';
|
|
4
|
+
import { IndicatorInfo } from 'src/components/win-card/components/IndicatorInfo';
|
|
5
|
+
import { RequestWrapper } from 'src/components/win-wrappers/request-wrapper';
|
|
6
|
+
import { getExtraLabel } from '../utils/tool';
|
|
7
|
+
|
|
8
|
+
export const Indicator = ({ configData, unit, orgLevelVal }: IContentProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<RequestWrapper
|
|
11
|
+
noEmptyBox
|
|
12
|
+
errorBoxHeight={50}
|
|
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={`/#/indicator-center/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
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
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 { IndicatorInfo } from 'src/components/win-card/components/IndicatorInfo';
|
|
10
|
+
import { RequestWrapper } from 'src/components/win-wrappers/request-wrapper';
|
|
11
|
+
import { INDICATOR_DATA_BASE_URL } from '../../../utils/const';
|
|
12
|
+
import { WinChart, WinChartType } from 'src/components/win-chart';
|
|
13
|
+
import { getExtraLabel } from '../utils/tool';
|
|
14
|
+
import { CnBox } from '@cainiaofe/cn-ui';
|
|
15
|
+
|
|
16
|
+
export const IndicatorArea = ({ configData, orgLevelVal }: IContentProps) => {
|
|
17
|
+
return (
|
|
18
|
+
<RequestWrapper
|
|
19
|
+
errorBoxHeight={90}
|
|
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
|
+
const curConfig = configData.indicatorConfig[0];
|
|
31
|
+
const subTitle = curConfig.extra?.subTitle;
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<CnBox direction='row' justify='space-between'>
|
|
35
|
+
<div>
|
|
36
|
+
<IndicatorInfo
|
|
37
|
+
jumpUrl={`/#/indicator-center/details?id=${curConfig.id}`}
|
|
38
|
+
label={configData.name}
|
|
39
|
+
unit={getListLabel(
|
|
40
|
+
unitList,
|
|
41
|
+
configData.indicatorConfig[0]?.unit,
|
|
42
|
+
)}
|
|
43
|
+
value={handleNumberShowStr(data.indicator?.value)}
|
|
44
|
+
extraLabel={getExtraLabel(subTitle) ?? data.indicator?.date}
|
|
45
|
+
extraValue={data.indicator?.expected}
|
|
46
|
+
isUnitWrap
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
<WinChart
|
|
50
|
+
color={configData.commonConfig.color}
|
|
51
|
+
data={data.list0 ?? []}
|
|
52
|
+
chartType={WinChartType.MINI_AREA}
|
|
53
|
+
style={{
|
|
54
|
+
width: 160,
|
|
55
|
+
height: 84,
|
|
56
|
+
}}
|
|
57
|
+
/>
|
|
58
|
+
</CnBox>
|
|
59
|
+
);
|
|
60
|
+
}}
|
|
61
|
+
</RequestWrapper>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { IStyleProps } from '@/types';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { getHandleOpenLink } from 'src/utils';
|
|
4
|
+
import { css, styled } from 'styled-components';
|
|
5
|
+
import { UnitWrapper } from 'src/components/win-wrappers/card-wrapper';
|
|
6
|
+
|
|
7
|
+
interface IProps extends IStyleProps {
|
|
8
|
+
label: string;
|
|
9
|
+
value: ReactNode;
|
|
10
|
+
unit: string;
|
|
11
|
+
extraLabel?: string;
|
|
12
|
+
extraValue?: ReactNode;
|
|
13
|
+
extraValueColor?: string;
|
|
14
|
+
jumpUrl?: string;
|
|
15
|
+
isUnitWrap?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const IndicatorInfo = ({
|
|
19
|
+
label,
|
|
20
|
+
value,
|
|
21
|
+
unit,
|
|
22
|
+
extraLabel,
|
|
23
|
+
extraValue,
|
|
24
|
+
extraValueColor,
|
|
25
|
+
jumpUrl,
|
|
26
|
+
isUnitWrap,
|
|
27
|
+
...args
|
|
28
|
+
}: Partial<IProps>) => {
|
|
29
|
+
return (
|
|
30
|
+
<div {...args}>
|
|
31
|
+
<LabelWrapper>
|
|
32
|
+
<div
|
|
33
|
+
data-value
|
|
34
|
+
onClick={getHandleOpenLink(jumpUrl)}
|
|
35
|
+
style={{
|
|
36
|
+
...(!!jumpUrl && {
|
|
37
|
+
cursor: 'pointer',
|
|
38
|
+
}),
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
{value}
|
|
42
|
+
{!isUnitWrap && <UnitWrapper>{unit}</UnitWrapper>}
|
|
43
|
+
</div>
|
|
44
|
+
</LabelWrapper>
|
|
45
|
+
{isUnitWrap && <UnitWrapper>{unit}</UnitWrapper>}
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const LabelWrapper = styled.div<{ unit?: string }>`
|
|
51
|
+
line-height: 1;
|
|
52
|
+
margin-top: 12px;
|
|
53
|
+
margin-bottom: 8px;
|
|
54
|
+
|
|
55
|
+
[data-label] {
|
|
56
|
+
width: 106px;
|
|
57
|
+
font-size: 12px;
|
|
58
|
+
margin-bottom: 8px;
|
|
59
|
+
display: flex;
|
|
60
|
+
|
|
61
|
+
${(props) =>
|
|
62
|
+
!!props.unit &&
|
|
63
|
+
css`
|
|
64
|
+
&::after {
|
|
65
|
+
content: '(${props.unit})';
|
|
66
|
+
display: inline-block;
|
|
67
|
+
color: #6d7a90;
|
|
68
|
+
}
|
|
69
|
+
`}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[data-value] {
|
|
73
|
+
font-size: 30px;
|
|
74
|
+
line-height: 16px;
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
color: #000;
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import $i18n from 'panda-i18n';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { checkEntityArr } from '@/utils';
|
|
4
|
+
import { MatterList } from './MatterList';
|
|
5
|
+
import { ICnPaging, IMatterInfo, IStyleProps, MatterType } from '@/types';
|
|
6
|
+
import { Box, CnPagination } from '@cainiaofe/cn-ui';
|
|
7
|
+
import { WorkbenchService } from 'src/services/WorkbenchService';
|
|
8
|
+
import { PanelTitleTab } from 'src/components/panel-title-tab';
|
|
9
|
+
import { RequestWrapper } from 'src/components/win-wrappers/request-wrapper';
|
|
10
|
+
|
|
11
|
+
const matterTitleList = [
|
|
12
|
+
{
|
|
13
|
+
label: $i18n.get({ id: 'TodoList', dm: '待办清单' }),
|
|
14
|
+
value: MatterType.PENDING,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: $i18n.get({ id: 'ISentOut', dm: '我发出的' }),
|
|
18
|
+
value: MatterType.CREATE,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: $i18n.get({ id: 'ItemsAlreadyHandled', dm: '已办事项' }),
|
|
22
|
+
value: MatterType.COMPLETE,
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
interface IProps extends IStyleProps {}
|
|
27
|
+
|
|
28
|
+
export const MatterContent = ({ style }: IProps) => {
|
|
29
|
+
const [curTitleTab, setCurTitleTab] = useState(MatterType.PENDING);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div style={style}>
|
|
33
|
+
<PanelTitleTab
|
|
34
|
+
value={curTitleTab}
|
|
35
|
+
onChange={setCurTitleTab}
|
|
36
|
+
dataList={matterTitleList}
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
{matterTitleList.map((item) => (
|
|
40
|
+
<MatterTable
|
|
41
|
+
key={item.value}
|
|
42
|
+
show={item.value === curTitleTab}
|
|
43
|
+
workflowType={item.value}
|
|
44
|
+
onChangeWorkflowType={setCurTitleTab}
|
|
45
|
+
/>
|
|
46
|
+
))}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const MatterTable = ({
|
|
52
|
+
show,
|
|
53
|
+
workflowType,
|
|
54
|
+
onChangeWorkflowType,
|
|
55
|
+
}: {
|
|
56
|
+
show: boolean;
|
|
57
|
+
workflowType: MatterType;
|
|
58
|
+
onChangeWorkflowType: (workflowType: MatterType) => void;
|
|
59
|
+
}) => {
|
|
60
|
+
const [hasInitData, setHasInitData] = useState(false);
|
|
61
|
+
const [paging, setPaging] = useState<Partial<ICnPaging>>({
|
|
62
|
+
currentPage: 1,
|
|
63
|
+
pageSize: 5,
|
|
64
|
+
});
|
|
65
|
+
const dataRef = useRef<IMatterInfo[]>();
|
|
66
|
+
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (hasInitData && !checkEntityArr(dataRef.current)) {
|
|
69
|
+
if (workflowType === MatterType.PENDING) {
|
|
70
|
+
onChangeWorkflowType(MatterType.CREATE);
|
|
71
|
+
} else if (workflowType === MatterType.CREATE) {
|
|
72
|
+
onChangeWorkflowType(MatterType.COMPLETE);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, [hasInitData, onChangeWorkflowType, workflowType]);
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div style={{ display: show ? 'block' : 'none' }}>
|
|
79
|
+
<RequestWrapper
|
|
80
|
+
initData={show}
|
|
81
|
+
errorBoxHeight={300}
|
|
82
|
+
requestData={{
|
|
83
|
+
workflowType,
|
|
84
|
+
currentPage: paging.currentPage,
|
|
85
|
+
pageSize: paging.pageSize,
|
|
86
|
+
}}
|
|
87
|
+
service={WorkbenchService.getMatterDataList}
|
|
88
|
+
>
|
|
89
|
+
{(data) => {
|
|
90
|
+
setHasInitData(true);
|
|
91
|
+
dataRef.current = data.tableData;
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<div>
|
|
95
|
+
<MatterList
|
|
96
|
+
data={data.tableData}
|
|
97
|
+
showHandle={workflowType === 'PENDING'}
|
|
98
|
+
/>
|
|
99
|
+
|
|
100
|
+
<Box direction="row" justify="flex-end">
|
|
101
|
+
<CnPagination
|
|
102
|
+
size="small"
|
|
103
|
+
shape="arrow-only"
|
|
104
|
+
total={data.paging.totalCount}
|
|
105
|
+
current={paging.currentPage}
|
|
106
|
+
onChange={(currentPage) =>
|
|
107
|
+
setPaging({
|
|
108
|
+
...paging,
|
|
109
|
+
currentPage,
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
pageSize={paging.pageSize}
|
|
113
|
+
/>
|
|
114
|
+
</Box>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
}}
|
|
118
|
+
</RequestWrapper>
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import $i18n from 'panda-i18n';
|
|
2
|
+
import { styled } from 'styled-components';
|
|
3
|
+
import { getHandleOpenLink, checkEntityArr } from '@/utils';
|
|
4
|
+
import { IMatterInfo } from 'src/types';
|
|
5
|
+
import { NoContent } from 'src/components/none-content';
|
|
6
|
+
import { CnBox } from '@cainiaofe/cn-ui';
|
|
7
|
+
import { IconBox } from '@/components/icon';
|
|
8
|
+
|
|
9
|
+
interface IProps {
|
|
10
|
+
data?: IMatterInfo[];
|
|
11
|
+
showHandle?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const MatterList = ({ data = [], showHandle }: IProps) => {
|
|
15
|
+
return (
|
|
16
|
+
<ListWrapper>
|
|
17
|
+
{checkEntityArr(data) ? (
|
|
18
|
+
data.map((item, index) => (
|
|
19
|
+
<DescriptionWrapper key={index}>
|
|
20
|
+
<CnBox direction="row" spacing={8}>
|
|
21
|
+
<IconBox
|
|
22
|
+
size={24}
|
|
23
|
+
src={
|
|
24
|
+
['TERMINATED', 'COMPLETED'].includes(item.status)
|
|
25
|
+
? DONE
|
|
26
|
+
: PROCESSING
|
|
27
|
+
}
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
<div>
|
|
31
|
+
<div
|
|
32
|
+
data-title
|
|
33
|
+
onClick={getHandleOpenLink(item.url)}
|
|
34
|
+
style={{
|
|
35
|
+
...(item.title.startsWith('【') && {
|
|
36
|
+
transform: 'translateX(-8px)',
|
|
37
|
+
}),
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
{item.title}
|
|
41
|
+
</div>
|
|
42
|
+
<div data-extra>
|
|
43
|
+
<span>
|
|
44
|
+
{$i18n.get(
|
|
45
|
+
{
|
|
46
|
+
id: 'InitiatoritemApplicantName',
|
|
47
|
+
dm: '发起人:{itemApplicantName}',
|
|
48
|
+
},
|
|
49
|
+
{ itemApplicantName: item.applicantName },
|
|
50
|
+
)}
|
|
51
|
+
</span>
|
|
52
|
+
<span>{item.applyTime}</span>
|
|
53
|
+
{!!item.handlerName && (
|
|
54
|
+
<span>
|
|
55
|
+
{$i18n.get(
|
|
56
|
+
{
|
|
57
|
+
id: 'CurrentApproveritemHandlerName',
|
|
58
|
+
dm: '当前审批人:{itemHandlerName}',
|
|
59
|
+
},
|
|
60
|
+
{ itemHandlerName: item.handlerName },
|
|
61
|
+
)}
|
|
62
|
+
</span>
|
|
63
|
+
)}
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</CnBox>
|
|
67
|
+
{showHandle && (
|
|
68
|
+
<HandleWrapper onClick={getHandleOpenLink(item.url)}>
|
|
69
|
+
👉去处理
|
|
70
|
+
</HandleWrapper>
|
|
71
|
+
)}
|
|
72
|
+
</DescriptionWrapper>
|
|
73
|
+
))
|
|
74
|
+
) : (
|
|
75
|
+
<NoContent
|
|
76
|
+
message={$i18n.get({ id: 'TERM.NoData', dm: '暂无数据' })}
|
|
77
|
+
style={{ transform: 'translateY(120px)' }}
|
|
78
|
+
/>
|
|
79
|
+
)}
|
|
80
|
+
</ListWrapper>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const ListWrapper = styled.div`
|
|
85
|
+
display: grid;
|
|
86
|
+
grid: auto-flow 64px / 1fr;
|
|
87
|
+
gap: 0;
|
|
88
|
+
line-height: 1;
|
|
89
|
+
font-size: 14px;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
height: 310px;
|
|
92
|
+
margin-bottom: 12px;
|
|
93
|
+
place-items: center stretch;
|
|
94
|
+
`;
|
|
95
|
+
|
|
96
|
+
const DescriptionWrapper = styled.div`
|
|
97
|
+
height: 100%;
|
|
98
|
+
border-top: solid #eee 1px;
|
|
99
|
+
display: grid;
|
|
100
|
+
grid: auto-flow / 1fr 70px;
|
|
101
|
+
place-items: center stretch;
|
|
102
|
+
|
|
103
|
+
[data-title] {
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
font-weight: 500;
|
|
106
|
+
font-size: 14px;
|
|
107
|
+
line-height: 1;
|
|
108
|
+
margin-bottom: 8px;
|
|
109
|
+
white-space: nowrap;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
color: #272f3d;
|
|
112
|
+
text-overflow: ellipsis;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[data-extra] {
|
|
116
|
+
font-size: 12px;
|
|
117
|
+
color: #5d677a;
|
|
118
|
+
line-height: 1;
|
|
119
|
+
span {
|
|
120
|
+
margin-right: 12px;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
const HandleWrapper = styled.div`
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
color: #272f3d;
|
|
128
|
+
font-size: 12px;
|
|
129
|
+
height: 22px;
|
|
130
|
+
text-align: center;
|
|
131
|
+
line-height: 21px;
|
|
132
|
+
border: solid #ddd 1px;
|
|
133
|
+
/* width: 80px; */
|
|
134
|
+
border-radius: 12px;
|
|
135
|
+
`;
|
|
136
|
+
|
|
137
|
+
const PROCESSING =
|
|
138
|
+
'https://img.alicdn.com/imgextra/i3/O1CN01HvOfeP1XOCe517Amr_!!6000000002913-55-tps-31-29.svg';
|
|
139
|
+
|
|
140
|
+
const DONE =
|
|
141
|
+
'https://img.alicdn.com/imgextra/i3/O1CN01jr6Aiq1EIjDAqHXkZ_!!6000000000329-55-tps-30-28.svg';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { NoticeList } from './NoticeList';
|
|
3
|
+
import { ICnPaging, IStyleProps } from '@/types';
|
|
4
|
+
import { Box, CnPagination } from '@cainiaofe/cn-ui';
|
|
5
|
+
import { WorkbenchService } from 'src/services/WorkbenchService';
|
|
6
|
+
import { RequestWrapper } from 'src/components/win-wrappers/request-wrapper';
|
|
7
|
+
import { useUserInfo } from 'src/components/WinMenu/hooks/useUserInfo';
|
|
8
|
+
|
|
9
|
+
interface IProps extends IStyleProps {}
|
|
10
|
+
|
|
11
|
+
export const NoticeContent = ({ style }: IProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<div style={style}>
|
|
14
|
+
<NoticeTable />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const NoticeTable = () => {
|
|
20
|
+
const userInfo = useUserInfo();
|
|
21
|
+
const [paging, setPaging] = useState<Partial<ICnPaging>>({
|
|
22
|
+
currentPage: 1,
|
|
23
|
+
pageSize: 10,
|
|
24
|
+
});
|
|
25
|
+
if (!userInfo.employeeId) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return (
|
|
29
|
+
<div>
|
|
30
|
+
<RequestWrapper
|
|
31
|
+
requestData={{
|
|
32
|
+
currentPage: paging.currentPage,
|
|
33
|
+
pageSize: paging.pageSize,
|
|
34
|
+
}}
|
|
35
|
+
isInside={userInfo.employeeType === 'inside'}
|
|
36
|
+
service={WorkbenchService.getNoticeDataList}
|
|
37
|
+
>
|
|
38
|
+
{(data) =>
|
|
39
|
+
data && (
|
|
40
|
+
<div>
|
|
41
|
+
<NoticeList
|
|
42
|
+
data={data.tableData}
|
|
43
|
+
isInside={userInfo.employeeType === 'inside'}
|
|
44
|
+
/>
|
|
45
|
+
<Box direction='row' justify='flex-end'>
|
|
46
|
+
<CnPagination
|
|
47
|
+
shape='arrow-only'
|
|
48
|
+
pageSizeSelector='dropdown'
|
|
49
|
+
pageSizeList={[10, 50, 100]}
|
|
50
|
+
total={data.paging.totalCount}
|
|
51
|
+
current={paging.currentPage}
|
|
52
|
+
onChange={(currentPage) =>
|
|
53
|
+
setPaging({
|
|
54
|
+
...paging,
|
|
55
|
+
currentPage,
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
pageSize={paging.pageSize}
|
|
59
|
+
onPageSizeChange={(pageSize) =>
|
|
60
|
+
setPaging({
|
|
61
|
+
...paging,
|
|
62
|
+
pageSize,
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
/>
|
|
66
|
+
</Box>
|
|
67
|
+
</div>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
</RequestWrapper>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { styled } from 'styled-components';
|
|
2
|
+
import {
|
|
3
|
+
getHandleOpenLink,
|
|
4
|
+
checkEntityArr,
|
|
5
|
+
getBossOrigin,
|
|
6
|
+
formatDate,
|
|
7
|
+
} from '@/utils';
|
|
8
|
+
import { IZNoticeInfo } from 'src/types';
|
|
9
|
+
import { NoContent } from 'src/components/none-content';
|
|
10
|
+
import { CnBox, CnButton } from '@cainiaofe/cn-ui';
|
|
11
|
+
|
|
12
|
+
interface IProps {
|
|
13
|
+
data?: IZNoticeInfo[];
|
|
14
|
+
isInside?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const NoticeList = ({ data = [], isInside }: IProps) => {
|
|
18
|
+
const bossOrigin = getBossOrigin(isInside);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<ListWrapper>
|
|
22
|
+
{checkEntityArr(data) ? (
|
|
23
|
+
data.map((item, index) => (
|
|
24
|
+
<CnBox
|
|
25
|
+
key={index}
|
|
26
|
+
align="center"
|
|
27
|
+
direction="row"
|
|
28
|
+
justify="space-between"
|
|
29
|
+
style={{ padding: '4px 0' }}
|
|
30
|
+
>
|
|
31
|
+
<CnButton
|
|
32
|
+
style={{
|
|
33
|
+
whiteSpace: 'normal',
|
|
34
|
+
lineHeight: '15px',
|
|
35
|
+
height: 'auto',
|
|
36
|
+
textAlign: 'left',
|
|
37
|
+
}}
|
|
38
|
+
text
|
|
39
|
+
type="primary"
|
|
40
|
+
onClick={getHandleOpenLink(
|
|
41
|
+
item.bizId
|
|
42
|
+
? `${bossOrigin}/basic/#/notice/detail?bizId=${item.bizId}`
|
|
43
|
+
: '',
|
|
44
|
+
)}
|
|
45
|
+
>
|
|
46
|
+
{item.title}
|
|
47
|
+
</CnButton>
|
|
48
|
+
<span>{formatDate(item.releaseDate)}</span>
|
|
49
|
+
</CnBox>
|
|
50
|
+
))
|
|
51
|
+
) : (
|
|
52
|
+
<NoContent style={{ transform: 'translateY(120px)' }} />
|
|
53
|
+
)}
|
|
54
|
+
</ListWrapper>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const ListWrapper = styled.div`
|
|
59
|
+
display: grid;
|
|
60
|
+
grid: auto-flow 24px / 1fr;
|
|
61
|
+
gap: 12px;
|
|
62
|
+
line-height: 1;
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
overflow: auto;
|
|
65
|
+
height: 330px;
|
|
66
|
+
margin-bottom: 12px;
|
|
67
|
+
place-items: center stretch;
|
|
68
|
+
`;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Select } from '@cainiaofe/cn-ui';
|
|
2
|
+
import { styled } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export const SelectDecoration = styled(Select).attrs({
|
|
5
|
+
size: 'small',
|
|
6
|
+
showSearch: true,
|
|
7
|
+
style: {
|
|
8
|
+
width: 130,
|
|
9
|
+
},
|
|
10
|
+
popupStyle: {
|
|
11
|
+
width: 200,
|
|
12
|
+
},
|
|
13
|
+
})`
|
|
14
|
+
transform: translateY(-4px);
|
|
15
|
+
|
|
16
|
+
span {
|
|
17
|
+
background: transparent;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export const IndicatorSelectDecoration = styled(Select).attrs({
|
|
22
|
+
size: 'small',
|
|
23
|
+
showSearch: true,
|
|
24
|
+
style: {
|
|
25
|
+
width: 100,
|
|
26
|
+
},
|
|
27
|
+
popupStyle: {
|
|
28
|
+
width: 200,
|
|
29
|
+
},
|
|
30
|
+
})`
|
|
31
|
+
span {
|
|
32
|
+
background: transparent;
|
|
33
|
+
}
|
|
34
|
+
`;
|