|
|
@@ -21,8 +21,7 @@ const Dashboard = ({ dispatch, permData = {}, groupList = [] }) => {
|
|
|
businessChainRatio: {},
|
|
|
serviceLogChainRatio: {},
|
|
|
aggregation: {},
|
|
|
- char: [],
|
|
|
- thread: [],
|
|
|
+ businessChar: {},
|
|
|
params: { businessGroupId: null, dataPermission: 'oneself', cyclical: 'month' }
|
|
|
})
|
|
|
const { toggleModal, setModalProps } = useModal()
|
|
|
@@ -46,8 +45,7 @@ const Dashboard = ({ dispatch, permData = {}, groupList = [] }) => {
|
|
|
businessChainRatio = {},
|
|
|
serviceLogChainRatio = {},
|
|
|
aggregation = {},
|
|
|
- char = [],
|
|
|
- thread = []
|
|
|
+ businessChar = {}
|
|
|
}
|
|
|
} = await queryDashboard(payload)
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
@@ -60,21 +58,23 @@ const Dashboard = ({ dispatch, permData = {}, groupList = [] }) => {
|
|
|
businessChainRatio,
|
|
|
serviceLogChainRatio,
|
|
|
aggregation,
|
|
|
- char,
|
|
|
- thread
|
|
|
+ businessChar
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
useEffect(() => {
|
|
|
- if (!groupList.length) {
|
|
|
+ if (!groupList) {
|
|
|
dispatch({
|
|
|
type: 'business/fetchGroup'
|
|
|
})
|
|
|
}
|
|
|
- if (groupList[0]?.value) {
|
|
|
- initData({ ...state.params, businessGroupId: groupList[0]?.value })
|
|
|
+ if (groupList?.length) {
|
|
|
+ setState({ ...state, params: { ...state.params, businessGroupId: groupList[0]?.value } })
|
|
|
}
|
|
|
- }, [state.params, groupList])
|
|
|
+ }, [groupList])
|
|
|
+ useEffect(() => {
|
|
|
+ state.params.businessGroupId && initData(state.params)
|
|
|
+ }, [state.params.businessGroupId, state.params.cyclical, state.params.dataPermission])
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '超过周期未服务提醒',
|
|
|
@@ -148,87 +148,18 @@ const Dashboard = ({ dispatch, permData = {}, groupList = [] }) => {
|
|
|
}
|
|
|
]
|
|
|
|
|
|
- const charData = state.char
|
|
|
- const threadData = state.thread
|
|
|
- // const uvBillData = [
|
|
|
- // {
|
|
|
- // time: '验证阶段',
|
|
|
- // value: 350,
|
|
|
- // type: '上个月'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '开发阶段',
|
|
|
- // value: 900,
|
|
|
- // type: '上个月'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '提案阶段',
|
|
|
- // value: 300,
|
|
|
- // type: '上个月'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '赢单',
|
|
|
- // value: 450,
|
|
|
- // type: '上个月'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '输单',
|
|
|
- // value: 470,
|
|
|
- // type: '上个月'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '验证阶段',
|
|
|
- // value: 220,
|
|
|
- // type: '本月'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '开发阶段',
|
|
|
- // value: 300,
|
|
|
- // type: '本月'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '提案阶段',
|
|
|
- // value: 250,
|
|
|
- // type: '本月'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '赢单',
|
|
|
- // value: 220,
|
|
|
- // type: '本月'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '输单',
|
|
|
- // value: 362,
|
|
|
- // type: '本月'
|
|
|
- // }
|
|
|
- // ]
|
|
|
- // const transformData = [
|
|
|
- // {
|
|
|
- // time: '验证阶段',
|
|
|
- // 增幅: 800
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '开发阶段',
|
|
|
- // 增幅: 600
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '提案阶段',
|
|
|
- // 增幅: 400
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '赢单',
|
|
|
- // 增幅: 380
|
|
|
- // },
|
|
|
- // {
|
|
|
- // time: '输单',
|
|
|
- // 增幅: 220
|
|
|
- // }
|
|
|
- // ]
|
|
|
+ const { char, thread } = state.businessChar
|
|
|
const config = {
|
|
|
- data: [charData, threadData],
|
|
|
+ data: [char, thread],
|
|
|
+ legend: { position: 'top' },
|
|
|
height: 230,
|
|
|
xField: 'time',
|
|
|
- yField: ['value', '增幅'],
|
|
|
+ yField: ['value', 'increment'],
|
|
|
+ meta: {
|
|
|
+ increment: {
|
|
|
+ alias: '增幅'
|
|
|
+ }
|
|
|
+ },
|
|
|
geometryOptions: [
|
|
|
{
|
|
|
geometry: 'column',
|
|
|
@@ -369,7 +300,7 @@ const Dashboard = ({ dispatch, permData = {}, groupList = [] }) => {
|
|
|
<div className="relative">
|
|
|
<span>销售漏斗</span>
|
|
|
<div className="absolute right-1 top-0">
|
|
|
- {groupList[0]?.value ? (
|
|
|
+ {groupList ? (
|
|
|
<Select
|
|
|
defaultValue={groupList[0]?.value}
|
|
|
options={groupList}
|
|
|
@@ -381,7 +312,7 @@ const Dashboard = ({ dispatch, permData = {}, groupList = [] }) => {
|
|
|
</div>
|
|
|
</div>
|
|
|
<Divider />
|
|
|
- <DualAxes {...config} />
|
|
|
+ {char && thread && <DualAxes {...config} />}
|
|
|
</div>
|
|
|
</Col>
|
|
|
<Col className="gutter-row" span={8}>
|